Compare commits

...

16 Commits

Author SHA1 Message Date
Ludovic BOUÉ
fc98a49fef Update strings.json 2025-11-17 08:23:38 +01:00
Ludovic BOUÉ
5918341103 Update comment
Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>
2025-11-17 08:16:06 +01:00
Ludovic BOUÉ
d914a0ccca Update test_binary_sensor.py
Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>
2025-11-17 08:15:29 +01:00
TheJulianJES
eae176db3c Remove duplicated eve_shutter from fixture 2025-11-17 07:04:29 +01:00
TheJulianJES
2a7fd5d7eb Merge branch 'dev' into window_covering_config_status 2025-11-17 06:46:09 +01:00
Ludovic BOUÉ
9c3e199a98 Update tests/components/matter/test_binary_sensor.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-07 21:19:49 +01:00
Ludovic BOUÉ
ccf3f8df52 Refactor Eve Shutter ConfigStatus to Status with operational state representation 2025-11-07 18:32:06 +00:00
Ludovic BOUÉ
eef11dc6e1 Update Eve Shutter ConfigStatus handling to reflect operational state changes 2025-11-07 18:20:42 +00:00
Ludovic BOUÉ
61c2eb16f5 Add Eve Shutter entity snapshots for button, cover, and sensor tests 2025-11-07 18:11:44 +00:00
Ludovic BOUÉ
29fbfff138 Add Eve Shutter and window covering config status entries to binary sensor tests 2025-11-07 17:58:21 +00:00
Ludovic BOUÉ
fd60b738c9 Update Eve Shutter test to reflect correct ConfigStatus state changes 2025-11-07 17:57:16 +00:00
Ludovic BOUÉ
fe94f978b2 Update window covering ConfigStatus handling in Matter binary sensor 2025-11-07 17:55:55 +00:00
Ludovic BOUÉ
3aea41c722 Add test for Eve Shutter ConfigStatus in binary sensor tests 2025-11-07 17:35:38 +00:00
Ludovic BOUÉ
750123cc1f Add Eve Shutter fixture and update integration fixture 2025-11-07 17:28:49 +00:00
Ludovic BOUÉ
99b6362b59 Add window covering configuration status to Matter strings 2025-11-07 17:27:31 +00:00
Ludovic BOUÉ
e1fa5a11cb Add Window Covering Config Status binary sensor to Matter discovery schemas 2025-11-07 17:26:10 +00:00
4 changed files with 382 additions and 0 deletions

View File

@@ -485,4 +485,19 @@ DISCOVERY_SCHEMAS = [
required_attributes=(clusters.RefrigeratorAlarm.Attributes.State,),
allow_multi=True,
),
MatterDiscoverySchema(
platform=Platform.BINARY_SENSOR,
entity_description=MatterBinarySensorEntityDescription(
key="WindowCoveringConfigStatusOperational",
translation_key="window_covering_config_status_operational",
device_class=BinarySensorDeviceClass.PROBLEM,
entity_category=EntityCategory.DIAGNOSTIC,
# unset Operational bit from ConfigStatus bitmap means problem
device_to_ha=lambda x: not bool(
x & clusters.WindowCovering.Bitmaps.ConfigStatus.kOperational
),
),
entity_class=MatterBinarySensor,
required_attributes=(clusters.WindowCovering.Attributes.ConfigStatus,),
),
]

View File

@@ -103,6 +103,9 @@
},
"water_leak": {
"name": "Water leak"
},
"window_covering_config_status_operational": {
"name": "Problem"
}
},
"button": {

View File

@@ -342,6 +342,55 @@
'state': 'on',
})
# ---
# name: test_binary_sensors[eve_shutter][binary_sensor.eve_shutter_switch_20eci1701_problem-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.eve_shutter_switch_20eci1701_problem',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.PROBLEM: 'problem'>,
'original_icon': None,
'original_name': 'Problem',
'platform': 'matter',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'window_covering_config_status_operational',
'unique_id': '00000000000004D2-0000000000000094-MatterNodeDevice-1-WindowCoveringConfigStatusOperational-258-7',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensors[eve_shutter][binary_sensor.eve_shutter_switch_20eci1701_problem-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'problem',
'friendly_name': 'Eve Shutter Switch 20ECI1701 Problem',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.eve_shutter_switch_20eci1701_problem',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensors[heiman_motion_sensor_m1][binary_sensor.smart_motion_sensor_occupancy-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
@@ -1516,3 +1565,297 @@
'state': 'off',
})
# ---
# name: test_binary_sensors[window_covering_full][binary_sensor.mock_full_window_covering_problem-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.mock_full_window_covering_problem',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.PROBLEM: 'problem'>,
'original_icon': None,
'original_name': 'Problem',
'platform': 'matter',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'window_covering_config_status_operational',
'unique_id': '00000000000004D2-0000000000000032-MatterNodeDevice-1-WindowCoveringConfigStatusOperational-258-7',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensors[window_covering_full][binary_sensor.mock_full_window_covering_problem-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'problem',
'friendly_name': 'Mock Full Window Covering Problem',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.mock_full_window_covering_problem',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensors[window_covering_lift][binary_sensor.mock_lift_window_covering_problem-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.mock_lift_window_covering_problem',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.PROBLEM: 'problem'>,
'original_icon': None,
'original_name': 'Problem',
'platform': 'matter',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'window_covering_config_status_operational',
'unique_id': '00000000000004D2-0000000000000032-MatterNodeDevice-1-WindowCoveringConfigStatusOperational-258-7',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensors[window_covering_lift][binary_sensor.mock_lift_window_covering_problem-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'problem',
'friendly_name': 'Mock Lift Window Covering Problem',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.mock_lift_window_covering_problem',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensors[window_covering_pa_lift][binary_sensor.longan_link_wncv_da01_problem-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.longan_link_wncv_da01_problem',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.PROBLEM: 'problem'>,
'original_icon': None,
'original_name': 'Problem',
'platform': 'matter',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'window_covering_config_status_operational',
'unique_id': '00000000000004D2-0000000000000001-MatterNodeDevice-1-WindowCoveringConfigStatusOperational-258-7',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensors[window_covering_pa_lift][binary_sensor.longan_link_wncv_da01_problem-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'problem',
'friendly_name': 'Longan link WNCV DA01 Problem',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.longan_link_wncv_da01_problem',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensors[window_covering_pa_tilt][binary_sensor.mock_pa_tilt_window_covering_problem-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.mock_pa_tilt_window_covering_problem',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.PROBLEM: 'problem'>,
'original_icon': None,
'original_name': 'Problem',
'platform': 'matter',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'window_covering_config_status_operational',
'unique_id': '00000000000004D2-0000000000000032-MatterNodeDevice-1-WindowCoveringConfigStatusOperational-258-7',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensors[window_covering_pa_tilt][binary_sensor.mock_pa_tilt_window_covering_problem-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'problem',
'friendly_name': 'Mock PA Tilt Window Covering Problem',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.mock_pa_tilt_window_covering_problem',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensors[window_covering_tilt][binary_sensor.mock_tilt_window_covering_problem-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.mock_tilt_window_covering_problem',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.PROBLEM: 'problem'>,
'original_icon': None,
'original_name': 'Problem',
'platform': 'matter',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'window_covering_config_status_operational',
'unique_id': '00000000000004D2-0000000000000032-MatterNodeDevice-1-WindowCoveringConfigStatusOperational-258-7',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensors[window_covering_tilt][binary_sensor.mock_tilt_window_covering_problem-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'problem',
'friendly_name': 'Mock Tilt Window Covering Problem',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.mock_tilt_window_covering_problem',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensors[zemismart_mt25b][binary_sensor.zemismart_mt25b_roller_motor_problem-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.zemismart_mt25b_roller_motor_problem',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.PROBLEM: 'problem'>,
'original_icon': None,
'original_name': 'Problem',
'platform': 'matter',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'window_covering_config_status_operational',
'unique_id': '00000000000004D2-000000000000007A-MatterNodeDevice-1-WindowCoveringConfigStatusOperational-258-7',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensors[zemismart_mt25b][binary_sensor.zemismart_mt25b_roller_motor_problem-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'problem',
'friendly_name': 'Zemismart MT25B Roller Motor Problem',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.zemismart_mt25b_roller_motor_problem',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---

View File

@@ -414,3 +414,24 @@ async def test_thermostat_occupancy(
state = hass.states.get("binary_sensor.longan_link_hvac_occupancy")
assert state
assert state.state == "off"
@pytest.mark.parametrize("node_fixture", ["eve_shutter"])
async def test_shutter_problem(
hass: HomeAssistant,
matter_client: MagicMock,
matter_node: MatterNode,
) -> None:
"""Test shutter problem."""
# Eve Shutter default state (ConfigStatus = 9)
state = hass.states.get("binary_sensor.eve_shutter_switch_20eci1701_problem")
assert state
assert state.state == "off"
# Eve Shutter ConfigStatus Operational bit not set
set_node_attribute(matter_node, 1, 258, 7, 8)
await trigger_subscription_callback(hass, matter_client)
state = hass.states.get("binary_sensor.eve_shutter_switch_20eci1701_problem")
assert state
assert state.state == "on"