mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Fix Shelly relay device set to light appliance type (#46181)
This commit is contained in:
parent
1f5fb8f28a
commit
6015161dab
@ -187,6 +187,11 @@ class ShellyLight(ShellyBlockEntity, LightEntity):
|
|||||||
|
|
||||||
async def async_turn_on(self, **kwargs) -> None:
|
async def async_turn_on(self, **kwargs) -> None:
|
||||||
"""Turn on light."""
|
"""Turn on light."""
|
||||||
|
if self.block.type == "relay":
|
||||||
|
self.control_result = await self.block.set_state(turn="on")
|
||||||
|
self.async_write_ha_state()
|
||||||
|
return
|
||||||
|
|
||||||
params = {"turn": "on"}
|
params = {"turn": "on"}
|
||||||
if ATTR_BRIGHTNESS in kwargs:
|
if ATTR_BRIGHTNESS in kwargs:
|
||||||
tmp_brightness = int(kwargs[ATTR_BRIGHTNESS] / 255 * 100)
|
tmp_brightness = int(kwargs[ATTR_BRIGHTNESS] / 255 * 100)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user