Compare commits

..

3 Commits

Author SHA1 Message Date
Franck Nijhof
16b8130676 Fix mypy errors for wled 0.22.0 Segment type changes
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 20:23:52 +00:00
Franck Nijhof
f6cfd69f6b Update tests/components/wled/test_update.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-16 22:10:48 +02:00
Franck Nijhof
87bcb34035 Update wled to v0.22.0 2026-04-16 20:02:48 +00:00
14 changed files with 62 additions and 153 deletions

View File

@@ -13,9 +13,6 @@
"disk_free": {
"default": "mdi:harddisk"
},
"disk_size": {
"default": "mdi:harddisk"
},
"disk_usage": {
"default": "mdi:harddisk"
},

View File

@@ -7,5 +7,5 @@
"integration_type": "service",
"iot_class": "local_polling",
"loggers": ["glances_api"],
"requirements": ["glances-api==0.10.0"]
"requirements": ["glances-api==0.8.0"]
}

View File

@@ -49,14 +49,6 @@ SENSOR_TYPES = {
device_class=SensorDeviceClass.DATA_SIZE,
state_class=SensorStateClass.MEASUREMENT,
),
("fs", "disk_size"): GlancesSensorEntityDescription(
key="disk_size",
type="fs",
translation_key="disk_size",
native_unit_of_measurement=UnitOfInformation.GIBIBYTES,
device_class=SensorDeviceClass.DATA_SIZE,
state_class=SensorStateClass.MEASUREMENT,
),
("fs", "disk_free"): GlancesSensorEntityDescription(
key="disk_free",
type="fs",

View File

@@ -50,9 +50,6 @@
"disk_free": {
"name": "{sensor_label} disk free"
},
"disk_size": {
"name": "{sensor_label} disk size"
},
"disk_usage": {
"name": "{sensor_label} disk usage"
},

View File

@@ -188,12 +188,11 @@ class WLEDSegmentLight(WLEDEntity, LightEntity):
# If this is the one and only segment, calculate brightness based
# on the main and segment brightness
segment_brightness = int(state.segments[self._segment].brightness)
if not self.coordinator.has_main_light:
return int(
(state.segments[self._segment].brightness * state.brightness) / 255
)
return int((segment_brightness * state.brightness) / 255)
return state.segments[self._segment].brightness
return segment_brightness
@property
def effect_list(self) -> list[str]:

View File

@@ -7,6 +7,6 @@
"integration_type": "device",
"iot_class": "local_push",
"quality_scale": "platinum",
"requirements": ["wled==0.21.0"],
"requirements": ["wled==0.22.0"],
"zeroconf": ["_wled._tcp.local."]
}

View File

@@ -54,7 +54,7 @@ NUMBERS = [
native_step=1,
native_min_value=0,
native_max_value=255,
value_fn=lambda segment: segment.speed,
value_fn=lambda segment: int(segment.speed),
),
WLEDNumberEntityDescription(
key=ATTR_INTENSITY,

4
requirements_all.txt generated
View File

@@ -1084,7 +1084,7 @@ gios==7.0.0
gitterpy==0.1.7
# homeassistant.components.glances
glances-api==0.10.0
glances-api==0.8.0
# homeassistant.components.go2rtc
go2rtc-client==0.4.0
@@ -3312,7 +3312,7 @@ wiim==0.1.0
wirelesstagpy==0.8.1
# homeassistant.components.wled
wled==0.21.0
wled==0.22.0
# homeassistant.components.wolflink
wolf-comm==0.0.48

View File

@@ -963,7 +963,7 @@ getmac==0.9.5
gios==7.0.0
# homeassistant.components.glances
glances-api==0.10.0
glances-api==0.8.0
# homeassistant.components.go2rtc
go2rtc-client==0.4.0
@@ -2806,7 +2806,7 @@ wiffi==1.1.2
wiim==0.1.0
# homeassistant.components.wled
wled==0.21.0
wled==0.22.0
# homeassistant.components.wolflink
wolf-comm==0.0.48

View File

@@ -16,18 +16,8 @@ MOCK_REFERENCE_DATE: datetime = datetime.fromisoformat("2024-02-13T14:13:12")
HA_SENSOR_DATA: dict[str, Any] = {
"fs": {
"/ssl": {
"disk_use": 30.7,
"disk_use_percent": 6.7,
"disk_free": 426.5,
"disk_size": 476.2,
},
"/media": {
"disk_use": 30.7,
"disk_use_percent": 6.7,
"disk_free": 426.5,
"disk_size": 476.2,
},
"/ssl": {"disk_use": 30.7, "disk_use_percent": 6.7, "disk_free": 426.5},
"/media": {"disk_use": 30.7, "disk_use_percent": 6.7, "disk_free": 426.5},
},
"diskio": {
"nvme0n1": {"read": 184320, "write": 23863296},

View File

@@ -916,64 +916,6 @@
'state': '426.5',
})
# ---
# name: test_sensor_states[sensor.0_0_0_0_media_disk_size-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.0_0_0_0_media_disk_size',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': '/media disk size',
'options': dict({
'sensor': dict({
'suggested_display_precision': 2,
}),
}),
'original_device_class': <SensorDeviceClass.DATA_SIZE: 'data_size'>,
'original_icon': None,
'original_name': '/media disk size',
'platform': 'glances',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'disk_size',
'unique_id': 'test-/media-disk_size',
'unit_of_measurement': <UnitOfInformation.GIBIBYTES: 'GiB'>,
})
# ---
# name: test_sensor_states[sensor.0_0_0_0_media_disk_size-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'data_size',
'friendly_name': '0.0.0.0 /media disk size',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfInformation.GIBIBYTES: 'GiB'>,
}),
'context': <ANY>,
'entity_id': 'sensor.0_0_0_0_media_disk_size',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '476.2',
})
# ---
# name: test_sensor_states[sensor.0_0_0_0_media_disk_usage-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
@@ -1839,64 +1781,6 @@
'state': '426.5',
})
# ---
# name: test_sensor_states[sensor.0_0_0_0_ssl_disk_size-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.0_0_0_0_ssl_disk_size',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': '/ssl disk size',
'options': dict({
'sensor': dict({
'suggested_display_precision': 2,
}),
}),
'original_device_class': <SensorDeviceClass.DATA_SIZE: 'data_size'>,
'original_icon': None,
'original_name': '/ssl disk size',
'platform': 'glances',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'disk_size',
'unique_id': 'test-/ssl-disk_size',
'unit_of_measurement': <UnitOfInformation.GIBIBYTES: 'GiB'>,
})
# ---
# name: test_sensor_states[sensor.0_0_0_0_ssl_disk_size-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'data_size',
'friendly_name': '0.0.0.0 /ssl disk size',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfInformation.GIBIBYTES: 'GiB'>,
}),
'context': <ANY>,
'entity_id': 'sensor.0_0_0_0_ssl_disk_size',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '476.2',
})
# ---
# name: test_sensor_states[sensor.0_0_0_0_ssl_disk_usage-entry]
EntityRegistryEntrySnapshot({
'aliases': list([

View File

@@ -60,6 +60,8 @@ def mock_wled_releases() -> Generator[MagicMock]:
wled_releases = wled_releases_mock.return_value
wled_releases.releases.return_value = Releases(
beta="1.0.0b5",
nightly=None,
repo="wled/WLED",
stable="0.99.0",
)

View File

@@ -194,6 +194,7 @@
'arch': 'esp32',
'brand': 'WLED',
'core': 'v3.3.6-16-gcc5440f6a2',
'cpalcount': 0,
'freeheap': 198384,
'fs': dict({
'pmt': 1718827787.0,
@@ -203,16 +204,19 @@
'fxcount': 187,
'ip': '127.0.0.1',
'leds': dict({
'cct': False,
'count': 30,
'fps': 5,
'light_capabilities': 1,
'max_power': 850,
'max_segments': 32,
'power': 515,
'rgbw': False,
'segment_light_capabilities': list([
1,
1,
]),
'wv': False,
}),
'lip': '',
'live': False,
@@ -221,6 +225,7 @@
'name': 'WLED RGB Light',
'palcount': 71,
'product': 'FOSS',
'str': False,
'udpport': 21324,
'uptime': 966,
'ver': '0.14.4',
@@ -306,17 +311,23 @@
}),
'state': dict({
'bri': 128,
'ledmap': 0,
'lor': 0,
'mainseg': 1,
'nl': dict({
'dur': 60,
'mode': 1,
'on': False,
'rem': -1,
'tbri': 0,
}),
'on': True,
'seg': dict({
'0': dict({
'bri': 255,
'c1': 128,
'c2': 128,
'c3': 16,
'cct': 127,
'cln': -1,
'col': list([
@@ -336,20 +347,39 @@
0,
]),
]),
'frz': False,
'fx': 0,
'grp': 1,
'id': 0,
'ix': 128,
'len': 15,
'm12': 0,
'mY': False,
'mi': False,
'o1': False,
'o2': False,
'o3': False,
'of': 0,
'on': True,
'pal': 0,
'rY': False,
'rev': False,
'sel': False,
'set': 0,
'si': 0,
'spc': 0,
'start': 0,
'startY': 0,
'stop': 15,
'stopY': 0,
'sx': 32,
'tp': False,
}),
'1': dict({
'bri': 255,
'c1': 128,
'c2': 128,
'c3': 16,
'cct': 127,
'cln': -1,
'col': list([
@@ -369,17 +399,33 @@
0,
]),
]),
'frz': False,
'fx': 3,
'grp': 1,
'id': 1,
'ix': 64,
'len': 15,
'm12': 0,
'mY': False,
'mi': False,
'o1': False,
'o2': False,
'o3': False,
'of': 0,
'on': True,
'pal': 1,
'rY': False,
'rev': True,
'sel': True,
'set': 0,
'si': 0,
'spc': 0,
'start': 15,
'startY': 0,
'stop': 30,
'stopY': 0,
'sx': 16,
'tp': False,
}),
}),
'transition': 7,

View File

@@ -63,6 +63,8 @@ async def test_update_information_available(
"""Test having no update information available at all."""
mock_wled_releases.releases.return_value = Releases(
beta=None,
nightly=None,
repo="https://github.com/wled/WLED",
stable=None,
)