Skip to content

Commit

Permalink
🚨 [2024-04-28] 移除警告信息: 删除电池电机的电量展示,有需求再做
Browse files Browse the repository at this point in the history
  • Loading branch information
MapleEve committed Apr 28, 2024
1 parent 7e2f10b commit 172843d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions custom_components/lifesmart/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import asyncio

from homeassistant.components.binary_sensor import BatteryEntity
from homeassistant.components.cover import (
ENTITY_ID_FORMAT,
ATTR_POSITION,
Expand Down Expand Up @@ -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):
Expand All @@ -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
Expand Down Expand Up @@ -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"}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 172843d

Please sign in to comment.