Upgrade wled to 0.5.0 (#51632)

This commit is contained in:
Franck Nijhof 2021-06-08 22:38:20 +02:00 committed by GitHub
parent d56bd61b93
commit d0fa4e1d48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 14 deletions

View File

@ -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(

View File

@ -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",

View File

@ -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

View File

@ -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

View File

@ -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