mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 08:47:57 +00:00
Add binary sensors to TotalConnect (#121888)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
parent
24144c5855
commit
53870617e8
@ -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(),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
|
@ -1,4 +1,14 @@
|
||||
{
|
||||
"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({
|
||||
|
Loading…
x
Reference in New Issue
Block a user