Bump fjaraskupan to 1.0.2 (#57992)
This commit is contained in:
parent
fe8b9caf99
commit
bc5422d737
5 changed files with 19 additions and 14 deletions
|
@ -9,7 +9,7 @@ import logging
|
|||
from bleak import BleakScanner
|
||||
from bleak.backends.device import BLEDevice
|
||||
from bleak.backends.scanner import AdvertisementData
|
||||
from fjaraskupan import Device, State, device_filter
|
||||
from fjaraskupan import UUID_SERVICE, Device, State, device_filter
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
|
@ -48,7 +48,7 @@ class EntryState:
|
|||
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
"""Set up Fjäråskupan from a config entry."""
|
||||
|
||||
scanner = BleakScanner()
|
||||
scanner = BleakScanner(filters={"UUIDs": [str(UUID_SERVICE)]})
|
||||
|
||||
state = EntryState(scanner, {})
|
||||
hass.data.setdefault(DOMAIN, {})
|
||||
|
@ -57,17 +57,20 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||
async def detection_callback(
|
||||
ble_device: BLEDevice, advertisement_data: AdvertisementData
|
||||
) -> None:
|
||||
if not device_filter(ble_device, advertisement_data):
|
||||
return
|
||||
|
||||
_LOGGER.debug(
|
||||
"Detection: %s %s - %s", ble_device.name, ble_device, advertisement_data
|
||||
)
|
||||
|
||||
if data := state.devices.get(ble_device.address):
|
||||
_LOGGER.debug(
|
||||
"Update: %s %s - %s", ble_device.name, ble_device, advertisement_data
|
||||
)
|
||||
|
||||
data.device.detection_callback(ble_device, advertisement_data)
|
||||
data.coordinator.async_set_updated_data(data.device.state)
|
||||
else:
|
||||
if not device_filter(ble_device, advertisement_data):
|
||||
return
|
||||
|
||||
_LOGGER.debug(
|
||||
"Detected: %s %s - %s", ble_device.name, ble_device, advertisement_data
|
||||
)
|
||||
|
||||
device = Device(ble_device)
|
||||
device.detection_callback(ble_device, advertisement_data)
|
||||
|
|
|
@ -7,7 +7,7 @@ import async_timeout
|
|||
from bleak import BleakScanner
|
||||
from bleak.backends.device import BLEDevice
|
||||
from bleak.backends.scanner import AdvertisementData
|
||||
from fjaraskupan import device_filter
|
||||
from fjaraskupan import UUID_SERVICE, device_filter
|
||||
|
||||
from homeassistant.helpers.config_entry_flow import register_discovery_flow
|
||||
|
||||
|
@ -25,7 +25,9 @@ async def _async_has_devices(hass) -> bool:
|
|||
if device_filter(device, advertisement_data):
|
||||
event.set()
|
||||
|
||||
async with BleakScanner(detection_callback=detection):
|
||||
async with BleakScanner(
|
||||
detection_callback=detection, filters={"UUIDs": [str(UUID_SERVICE)]}
|
||||
):
|
||||
try:
|
||||
async with async_timeout.timeout(CONST_WAIT_TIME):
|
||||
await event.wait()
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"config_flow": true,
|
||||
"documentation": "https://www.home-assistant.io/integrations/fjaraskupan",
|
||||
"requirements": [
|
||||
"fjaraskupan==1.0.1"
|
||||
"fjaraskupan==1.0.2"
|
||||
],
|
||||
"codeowners": [
|
||||
"@elupus"
|
||||
|
|
|
@ -646,7 +646,7 @@ fitbit==0.3.1
|
|||
fixerio==1.0.0a0
|
||||
|
||||
# homeassistant.components.fjaraskupan
|
||||
fjaraskupan==1.0.1
|
||||
fjaraskupan==1.0.2
|
||||
|
||||
# homeassistant.components.flipr
|
||||
flipr-api==1.4.1
|
||||
|
|
|
@ -378,7 +378,7 @@ faadelays==0.0.7
|
|||
feedparser==6.0.2
|
||||
|
||||
# homeassistant.components.fjaraskupan
|
||||
fjaraskupan==1.0.1
|
||||
fjaraskupan==1.0.2
|
||||
|
||||
# homeassistant.components.flipr
|
||||
flipr-api==1.4.1
|
||||
|
|
Loading…
Add table
Reference in a new issue