Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion indigo-matter.indigoPlugin/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<key>IwsApiVersion</key>
<string>1.0.0</string>
<key>PluginVersion</key>
<string>2026.4.1</string>
<string>2026.4.2</string>
<key>ServerApiVersion</key>
<string>3.6</string>
</dict>
Expand Down
28 changes: 27 additions & 1 deletion tests/test_device_zoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
3. every spec's device_type_id exists in Devices.xml;
4. every initial state is XML-declared or an Indigo built-in;
5. every sensor-type spec carries explicit SupportsOnState /
SupportsSensorValue with exactly one True (the issue #56 class).
SupportsSensorValue with exactly one True (the issue #56 class);
6. no device type's <States> block redeclares a state key that a True
Supports* prop already derives natively (the PR #73 class — Indigo
rejects plugin-declared state keys that duplicate a native one).
"""
from __future__ import annotations

Expand Down Expand Up @@ -54,6 +57,15 @@
"matterThermostat", "matterWindowCovering", "matterLock", "matterValve",
}

# Supports* creation prop → the native Indigo state key it derives (PR #73:
# Indigo rejects a plugin-declared <State> that duplicates one of these).
NATIVE_STATE_KEY_BY_PROP = {
"SupportsSensorValue": "sensorValue",
"SupportsOnState": "onOffState",
"SupportsPowerMeter": "curEnergyLevel",
"SupportsEnergyMeter": "accumEnergyTotal",
}



def _raw(node_id, eps):
Expand Down Expand Up @@ -275,6 +287,20 @@ def test_zoo_sensor_specs_carry_explicit_display_props(name):
)


@pytest.mark.parametrize("name", ZOO)
def test_zoo_native_props_not_redeclared_in_devices_xml(name):
raw, _ = ZOO[name]
for specs in _specs_by_endpoint(raw).values():
for spec in specs:
declared = XML_STATES_BY_ID.get(spec.device_type_id, set())
for prop, key in NATIVE_STATE_KEY_BY_PROP.items():
if spec.props.get(prop) is True:
assert key not in declared, (
f"{name}: {spec.device_type_id} declares native state "
f"'{key}' in Devices.xml even though {prop} is True"
)


def test_every_registered_handler_type_exists_in_devices_xml():
# Registry-wide, zoo-independent: a handler pointing at a typo'd or
# removed Devices.xml id would create devices that Indigo rejects.
Expand Down
Loading