J. Nick Koston 2022-12-18 14:54:29 -10:00 committed by GitHub
parent b96eab3e5e
commit 884fbdd5ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 5 deletions

View File

@ -8,6 +8,7 @@ from typing import TYPE_CHECKING, Any
import async_timeout
import switchbot
from switchbot import SwitchbotModel
from homeassistant.components import bluetooth
from homeassistant.components.bluetooth.passive_update_coordinator import (
@ -44,7 +45,7 @@ class SwitchbotDataUpdateCoordinator(PassiveBluetoothDataUpdateCoordinator):
base_unique_id: str,
device_name: str,
connectable: bool,
model: str,
model: SwitchbotModel,
) -> None:
"""Initialize global switchbot data updater."""
super().__init__(
@ -81,7 +82,7 @@ class SwitchbotDataUpdateCoordinator(PassiveBluetoothDataUpdateCoordinator):
self.ble_device = service_info.device
if not (
adv := switchbot.parse_advertisement_data(
service_info.device, service_info.advertisement
service_info.device, service_info.advertisement, self.model
)
):
return

View File

@ -2,7 +2,7 @@
"domain": "switchbot",
"name": "SwitchBot",
"documentation": "https://www.home-assistant.io/integrations/switchbot",
"requirements": ["PySwitchbot==0.23.2"],
"requirements": ["PySwitchbot==0.29.1"],
"config_flow": true,
"dependencies": ["bluetooth"],
"codeowners": [
@ -24,6 +24,14 @@
{
"service_uuid": "cba20d00-224d-11e6-9fb8-0002a5d5c51b",
"connectable": false
},
{
"manufacturer_id": 2409,
"connectable": false
},
{
"manufacturer_id": 89,
"connectable": true
}
],
"iot_class": "local_push",

View File

@ -332,6 +332,16 @@ BLUETOOTH: list[dict[str, bool | str | int | list[int]]] = [
"domain": "switchbot",
"service_uuid": "cba20d00-224d-11e6-9fb8-0002a5d5c51b",
},
{
"connectable": False,
"domain": "switchbot",
"manufacturer_id": 2409,
},
{
"connectable": True,
"domain": "switchbot",
"manufacturer_id": 89,
},
{
"connectable": False,
"domain": "thermobeacon",

View File

@ -40,7 +40,7 @@ PyRMVtransport==0.3.3
PySocks==1.7.1
# homeassistant.components.switchbot
PySwitchbot==0.23.2
PySwitchbot==0.29.1
# homeassistant.components.transport_nsw
PyTransportNSW==0.1.1

View File

@ -36,7 +36,7 @@ PyRMVtransport==0.3.3
PySocks==1.7.1
# homeassistant.components.switchbot
PySwitchbot==0.23.2
PySwitchbot==0.29.1
# homeassistant.components.transport_nsw
PyTransportNSW==0.1.1