Skip to content
Snippets Groups Projects
Unverified Commit 53870617 authored by Austin Mroczek's avatar Austin Mroczek Committed by GitHub
Browse files

Add binary sensors to TotalConnect (#121888)

parent 24144c58
No related branches found
No related tags found
No related merge requests found
......@@ -101,6 +101,21 @@ LOCATION_BINARY_SENSORS: tuple[TotalConnectAlarmBinarySensorEntityDescription, .
entity_category=EntityCategory.DIAGNOSTIC,
is_on_fn=lambda location: location.is_ac_loss(),
),
TotalConnectAlarmBinarySensorEntityDescription(
key="smoke",
device_class=BinarySensorDeviceClass.SMOKE,
is_on_fn=lambda location: location.arming_state.is_triggered_fire(),
),
TotalConnectAlarmBinarySensorEntityDescription(
key="carbon_monoxide",
device_class=BinarySensorDeviceClass.CO,
is_on_fn=lambda location: location.arming_state.is_triggered_gas(),
),
TotalConnectAlarmBinarySensorEntityDescription(
key="police",
translation_key="police",
is_on_fn=lambda location: location.arming_state.is_triggered_police(),
),
)
......
{
"entity": {
"binary_sensor": {
"police": {
"default": "mdi:police-badge-outline",
"state": {
"on": "mdi:police-badge"
}
}
}
},
"services": {
"arm_away_instant": "mdi:shield-lock",
"arm_home_instant": "mdi:shield-home"
......
......@@ -56,6 +56,15 @@
"name": "Partition {partition_id}"
}
},
"binary_sensor": {
"police": {
"name": "Police emergency",
"state": {
"off": "No emergency",
"on": "Police emergency"
}
}
},
"button": {
"clear_bypass": {
"name": "Clear bypass"
......
......@@ -847,6 +847,101 @@
'state': 'off',
})
# ---
# name: test_entity_registry[binary_sensor.test_carbon_monoxide-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.test_carbon_monoxide',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.CO: 'carbon_monoxide'>,
'original_icon': None,
'original_name': 'Carbon monoxide',
'platform': 'totalconnect',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '123456_carbon_monoxide',
'unit_of_measurement': None,
})
# ---
# name: test_entity_registry[binary_sensor.test_carbon_monoxide-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'carbon_monoxide',
'friendly_name': 'test Carbon monoxide',
'location_id': '123456',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.test_carbon_monoxide',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_entity_registry[binary_sensor.test_police_emergency-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.test_police_emergency',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Police emergency',
'platform': 'totalconnect',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'police',
'unique_id': '123456_police',
'unit_of_measurement': None,
})
# ---
# name: test_entity_registry[binary_sensor.test_police_emergency-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'test Police emergency',
'location_id': '123456',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.test_police_emergency',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_entity_registry[binary_sensor.test_power-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
......@@ -895,6 +990,54 @@
'state': 'off',
})
# ---
# name: test_entity_registry[binary_sensor.test_smoke-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.test_smoke',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.SMOKE: 'smoke'>,
'original_icon': None,
'original_name': 'Smoke',
'platform': 'totalconnect',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '123456_smoke',
'unit_of_measurement': None,
})
# ---
# name: test_entity_registry[binary_sensor.test_smoke-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'smoke',
'friendly_name': 'test Smoke',
'location_id': '123456',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.test_smoke',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_entity_registry[binary_sensor.test_tamper-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment