Skip to content

Commit

Permalink
🐛 [2024-04-24] 修复 BUG: climate light cover not init. Fix lock states
Browse files Browse the repository at this point in the history
  • Loading branch information
MapleEve committed Apr 24, 2024
1 parent 4af2e15 commit d98595c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions custom_components/lifesmart/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,10 @@ async def data_update_handler(msg):
).strftime("%Y-%m-%d %H:%M:%S"),
}

#hass.states.set(entity_id, nstat, attrs)

dispatcher_send(
hass, f"{LIFESMART_SIGNAL_UPDATE_ENTITY}_{entity_id}", attrs
hass, f"{LIFESMART_SIGNAL_UPDATE_ENTITY}_{entity_id}", data
)
hass.states.set(entity_id, nstat, attrs)
_LOGGER.debug("设备状态更新已推送 %s - 设备编号:%s -门锁更新数据:%s ",
str(LIFESMART_SIGNAL_UPDATE_ENTITY),
str(entity_id), str(data))
Expand Down
8 changes: 4 additions & 4 deletions custom_components/lifesmart/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
FAN_MEDIUM,
)


from homeassistant.const import (
ATTR_TEMPERATURE,
PRECISION_WHOLE,
TEMP_CELSIUS,
TEMP_FAHRENHEIT,
UnitOfTemperature,
)

from . import LifeSmartDevice
Expand Down Expand Up @@ -47,7 +47,7 @@
LIFESMART_STATE_LIST


async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
async def async_setup_entry(hass, config, async_add_entities, discovery_info=None):
"""Set up LifeSmart Climate devices."""
if discovery_info is None:
return
Expand Down Expand Up @@ -117,7 +117,7 @@ def precision(self):
@property
def temperature_unit(self):
"""Return the unit of measurement used by the platform."""
return TEMP_CELSIUS
return UnitOfTemperature.CELSIUS

@property
def target_temperature_step(self):
Expand Down
2 changes: 1 addition & 1 deletion custom_components/lifesmart/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from . import LifeSmartDevice


async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
async def async_setup_entry(hass, config, async_add_entities, discovery_info=None):
"""Set up lifesmart dooya cover devices."""
if discovery_info is None:
return
Expand Down
2 changes: 1 addition & 1 deletion custom_components/lifesmart/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
MIN_MIREDS = int(1000000 / 6500)


async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
async def async_setup_entry(hass, config, async_add_entities, discovery_info=None):
"""Perform the setup for LifeSmart devices."""
if discovery_info is None:
return
Expand Down

0 comments on commit d98595c

Please sign in to comment.