New apps Added
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -5,6 +5,7 @@ from datetime import datetime, timedelta
|
||||
from typing import Dict
|
||||
|
||||
from bleak import BleakClient
|
||||
from bleak.exc import BleakCharacteristicNotFoundError
|
||||
from bleak_retry_connector import establish_connection
|
||||
|
||||
from homeassistant.components import bluetooth
|
||||
@@ -48,6 +49,8 @@ class WyzeLockBoltCoordinator(DataUpdateCoordinator):
|
||||
self._mac = None
|
||||
self._bleak_client = None
|
||||
self._current_command = None
|
||||
# Initialize data to prevent errors during setup
|
||||
self.data = {"state": None, "timestamp": None}
|
||||
|
||||
@token_exception_handler
|
||||
async def update_lock_info(self):
|
||||
@@ -71,6 +74,11 @@ class WyzeLockBoltCoordinator(DataUpdateCoordinator):
|
||||
try:
|
||||
value = await client.read_gatt_char(YDBLE_LOCK_STATE_UUID)
|
||||
return self._parse_state(value)
|
||||
except BleakCharacteristicNotFoundError as e:
|
||||
raise UpdateFailed(
|
||||
f"Characteristic {YDBLE_LOCK_STATE_UUID} not found on device {self._lock.nickname}. "
|
||||
"Device may be locked, have firmware issues, or require pairing."
|
||||
) from e
|
||||
finally:
|
||||
await self._disconnect()
|
||||
|
||||
|
||||
@@ -179,9 +179,8 @@ class WyzeLight(LightEntity):
|
||||
self._bulb.color_mode = "2"
|
||||
|
||||
self._bulb.color_temp = color_temp
|
||||
self._bulb.color = color_util.color_rgb_to_hex(
|
||||
*color_util.color_temperature_to_rgb(color_temp)
|
||||
)
|
||||
r, g, b = color_util.color_temperature_to_rgb(color_temp)
|
||||
self._bulb.color = color_util.color_rgb_to_hex(int(r), int(g), int(b))
|
||||
|
||||
if kwargs.get(ATTR_HS_COLOR) is not None and (
|
||||
self._device_type is DeviceTypes.MESH_LIGHT
|
||||
|
||||
@@ -71,7 +71,7 @@ async def async_setup_entry(
|
||||
continue
|
||||
lock_bolts.append(WyzeLockBolt(coordinator))
|
||||
|
||||
async_add_entities(locks + lock_bolts, True)
|
||||
async_add_entities(locks + lock_bolts, False)
|
||||
|
||||
|
||||
class WyzeLock(homeassistant.components.lock.LockEntity, ABC):
|
||||
@@ -249,6 +249,8 @@ class WyzeLockBolt(CoordinatorEntity, homeassistant.components.lock.LockEntity):
|
||||
|
||||
@property
|
||||
def is_locked(self):
|
||||
if self.coordinator.data is None or self.coordinator.data.get("state") is None:
|
||||
return None
|
||||
return self.coordinator.data["state"] == 1
|
||||
|
||||
async def async_lock(self, **kwargs):
|
||||
@@ -267,4 +269,6 @@ class WyzeLockBolt(CoordinatorEntity, homeassistant.components.lock.LockEntity):
|
||||
|
||||
@property
|
||||
def state_attributes(self):
|
||||
if self.coordinator.data is None:
|
||||
return {}
|
||||
return {"last_operated": self.coordinator.data["timestamp"]}
|
||||
|
||||
@@ -14,5 +14,5 @@
|
||||
"wyzeapy>=0.5.33,<0.6",
|
||||
"websockets"
|
||||
],
|
||||
"version": "0.1.37"
|
||||
"version": "0.1.38"
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ async def async_setup_entry(
|
||||
hass, config_entry, devices_to_migrate, device_registry
|
||||
)
|
||||
|
||||
async_add_entities(switches, True)
|
||||
async_add_entities(switches, False)
|
||||
|
||||
|
||||
async def async_migrate_switch_data(
|
||||
|
||||
Reference in New Issue
Block a user