mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 22:37:11 +00:00
Upgrade wled to 0.5.0 (#51632)
This commit is contained in:
parent
d56bd61b93
commit
d0fa4e1d48
@ -124,7 +124,7 @@ class WLEDMasterLight(WLEDEntity, LightEntity):
|
||||
# WLED uses 100ms per unit, so 10 = 1 second.
|
||||
data[ATTR_TRANSITION] = round(kwargs[ATTR_TRANSITION] * 10)
|
||||
|
||||
await self.coordinator.wled.master(**data)
|
||||
await self.coordinator.wled.master(**data) # type: ignore[arg-type]
|
||||
|
||||
@wled_exception_handler
|
||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||
@ -138,7 +138,7 @@ class WLEDMasterLight(WLEDEntity, LightEntity):
|
||||
if ATTR_BRIGHTNESS in kwargs:
|
||||
data[ATTR_BRIGHTNESS] = kwargs[ATTR_BRIGHTNESS]
|
||||
|
||||
await self.coordinator.wled.master(**data)
|
||||
await self.coordinator.wled.master(**data) # type: ignore[arg-type]
|
||||
|
||||
async def async_effect(
|
||||
self,
|
||||
@ -195,11 +195,11 @@ class WLEDSegmentLight(WLEDEntity, LightEntity):
|
||||
@property
|
||||
def extra_state_attributes(self) -> dict[str, Any] | None:
|
||||
"""Return the state attributes of the entity."""
|
||||
playlist = self.coordinator.data.state.playlist
|
||||
playlist: int | None = self.coordinator.data.state.playlist
|
||||
if playlist == -1:
|
||||
playlist = None
|
||||
|
||||
preset = self.coordinator.data.state.preset
|
||||
preset: int | None = self.coordinator.data.state.preset
|
||||
if preset == -1:
|
||||
preset = None
|
||||
|
||||
@ -287,11 +287,11 @@ class WLEDSegmentLight(WLEDEntity, LightEntity):
|
||||
|
||||
# If there is a single segment, control via the master
|
||||
if len(self.coordinator.data.state.segments) == 1:
|
||||
await self.coordinator.wled.master(**data)
|
||||
await self.coordinator.wled.master(**data) # type: ignore[arg-type]
|
||||
return
|
||||
|
||||
data[ATTR_SEGMENT_ID] = self._segment
|
||||
await self.coordinator.wled.segment(**data)
|
||||
await self.coordinator.wled.segment(**data) # type: ignore[arg-type]
|
||||
|
||||
@wled_exception_handler
|
||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||
@ -389,7 +389,7 @@ class WLEDSegmentLight(WLEDEntity, LightEntity):
|
||||
if speed is not None:
|
||||
data[ATTR_SPEED] = speed
|
||||
|
||||
await self.coordinator.wled.segment(**data)
|
||||
await self.coordinator.wled.segment(**data) # type: ignore[arg-type]
|
||||
|
||||
@wled_exception_handler
|
||||
async def async_preset(
|
||||
|
@ -3,7 +3,7 @@
|
||||
"name": "WLED",
|
||||
"config_flow": true,
|
||||
"documentation": "https://www.home-assistant.io/integrations/wled",
|
||||
"requirements": ["wled==0.4.4"],
|
||||
"requirements": ["wled==0.5.0"],
|
||||
"zeroconf": ["_wled._tcp.local."],
|
||||
"codeowners": ["@frenck"],
|
||||
"quality_scale": "platinum",
|
||||
|
@ -121,8 +121,10 @@ class WLEDWifiSignalSensor(WLEDEntity, SensorEntity):
|
||||
self._attr_unique_id = f"{coordinator.data.info.mac_address}_wifi_signal"
|
||||
|
||||
@property
|
||||
def state(self) -> int:
|
||||
def state(self) -> int | None:
|
||||
"""Return the state of the sensor."""
|
||||
if not self.coordinator.data.info.wifi:
|
||||
return None
|
||||
return self.coordinator.data.info.wifi.signal
|
||||
|
||||
|
||||
@ -140,8 +142,10 @@ class WLEDWifiRSSISensor(WLEDEntity, SensorEntity):
|
||||
self._attr_unique_id = f"{coordinator.data.info.mac_address}_wifi_rssi"
|
||||
|
||||
@property
|
||||
def state(self) -> int:
|
||||
def state(self) -> int | None:
|
||||
"""Return the state of the sensor."""
|
||||
if not self.coordinator.data.info.wifi:
|
||||
return None
|
||||
return self.coordinator.data.info.wifi.rssi
|
||||
|
||||
|
||||
@ -158,8 +162,10 @@ class WLEDWifiChannelSensor(WLEDEntity, SensorEntity):
|
||||
self._attr_unique_id = f"{coordinator.data.info.mac_address}_wifi_channel"
|
||||
|
||||
@property
|
||||
def state(self) -> int:
|
||||
def state(self) -> int | None:
|
||||
"""Return the state of the sensor."""
|
||||
if not self.coordinator.data.info.wifi:
|
||||
return None
|
||||
return self.coordinator.data.info.wifi.channel
|
||||
|
||||
|
||||
@ -176,6 +182,8 @@ class WLEDWifiBSSIDSensor(WLEDEntity, SensorEntity):
|
||||
self._attr_unique_id = f"{coordinator.data.info.mac_address}_wifi_bssid"
|
||||
|
||||
@property
|
||||
def state(self) -> str:
|
||||
def state(self) -> str | None:
|
||||
"""Return the state of the sensor."""
|
||||
if not self.coordinator.data.info.wifi:
|
||||
return None
|
||||
return self.coordinator.data.info.wifi.bssid
|
||||
|
@ -2359,7 +2359,7 @@ wirelesstagpy==0.4.1
|
||||
withings-api==2.3.2
|
||||
|
||||
# homeassistant.components.wled
|
||||
wled==0.4.4
|
||||
wled==0.5.0
|
||||
|
||||
# homeassistant.components.wolflink
|
||||
wolf_smartset==0.1.8
|
||||
|
@ -1274,7 +1274,7 @@ wiffi==1.0.1
|
||||
withings-api==2.3.2
|
||||
|
||||
# homeassistant.components.wled
|
||||
wled==0.4.4
|
||||
wled==0.5.0
|
||||
|
||||
# homeassistant.components.wolflink
|
||||
wolf_smartset==0.1.8
|
||||
|
Loading…
x
Reference in New Issue
Block a user