From 172843d59d815273609b2be56bba56e30e0e1e11 Mon Sep 17 00:00:00 2001 From: Maple Gao Date: Sun, 28 Apr 2024 21:08:41 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20[2024-04-28]=20=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E8=AD=A6=E5=91=8A=E4=BF=A1=E6=81=AF:=20=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E7=94=B5=E6=B1=A0=E7=94=B5=E6=9C=BA=E7=9A=84=E7=94=B5?= =?UTF-8?q?=E9=87=8F=E5=B1=95=E7=A4=BA=EF=BC=8C=E6=9C=89=E9=9C=80=E6=B1=82?= =?UTF-8?q?=E5=86=8D=E5=81=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom_components/lifesmart/cover.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/custom_components/lifesmart/cover.py b/custom_components/lifesmart/cover.py index 7686136..18e7762 100644 --- a/custom_components/lifesmart/cover.py +++ b/custom_components/lifesmart/cover.py @@ -2,7 +2,6 @@ import asyncio -from homeassistant.components.binary_sensor import BatteryEntity from homeassistant.components.cover import ( ENTITY_ID_FORMAT, ATTR_POSITION, @@ -65,7 +64,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities): async_add_entities(cover_devices) -class LifeSmartCover(LifeSmartDevice, CoverEntity, BatteryEntity): +class LifeSmartCover(LifeSmartDevice, CoverEntity): """LifeSmart cover devices.""" def __init__(self, device, raw_device_data, idx, val, client): @@ -78,7 +77,6 @@ def __init__(self, device, raw_device_data, idx, val, client): device_id = raw_device_data[DEVICE_ID_KEY] self._attr_has_entity_name = True - self._attr_battery_level = None self.device_name = device_name self.sensor_device_name = raw_device_data[DEVICE_NAME_KEY] self.device_id = device_id @@ -115,7 +113,6 @@ def __init__(self, device, raw_device_data, idx, val, client): self._open_cmd = {"type": "0x81", "val": 1, "idx": "P2"} self._close_cmd = {"type": "0x81", "val": 1, "idx": "P3"} self._stop_cmd = {"type": "0x81", "val": 1, "idx": "P4"} - self._attr_battery_level = raw_device_data["P8"]["v"] elif device_type == "SL_SW_WIN": self._open_cmd = {"type": "0x81", "val": 1, "idx": "OP"} self._close_cmd = {"type": "0x81", "val": 1, "idx": "CL"} @@ -254,7 +251,6 @@ async def _update_state(self, data) -> None: for idx in self._idx: self._pos[idx] = data[idx]["val"] self._state = self._pos["P2"] - self._attr_battery_level = data["P8"]["v"] if data["P2"]["type"] & 0x01 == 1: self._is_opening = True self._is_closing = False