mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
Add power protection entities for tplink (#132267)
Co-authored-by: Steven B <51370195+sdb9696@users.noreply.github.com> Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
48dfa037bd
commit
94e4863cbe
@ -35,6 +35,10 @@ BINARY_SENSOR_DESCRIPTIONS: Final = (
|
|||||||
key="overheated",
|
key="overheated",
|
||||||
device_class=BinarySensorDeviceClass.PROBLEM,
|
device_class=BinarySensorDeviceClass.PROBLEM,
|
||||||
),
|
),
|
||||||
|
TPLinkBinarySensorEntityDescription(
|
||||||
|
key="overloaded",
|
||||||
|
device_class=BinarySensorDeviceClass.PROBLEM,
|
||||||
|
),
|
||||||
TPLinkBinarySensorEntityDescription(
|
TPLinkBinarySensorEntityDescription(
|
||||||
key="battery_low",
|
key="battery_low",
|
||||||
device_class=BinarySensorDeviceClass.BATTERY,
|
device_class=BinarySensorDeviceClass.BATTERY,
|
||||||
|
@ -65,6 +65,10 @@ NUMBER_DESCRIPTIONS: Final = (
|
|||||||
key="tilt_step",
|
key="tilt_step",
|
||||||
mode=NumberMode.BOX,
|
mode=NumberMode.BOX,
|
||||||
),
|
),
|
||||||
|
TPLinkNumberEntityDescription(
|
||||||
|
key="power_protection_threshold",
|
||||||
|
mode=NumberMode.SLIDER,
|
||||||
|
),
|
||||||
TPLinkNumberEntityDescription(
|
TPLinkNumberEntityDescription(
|
||||||
key="clean_count",
|
key="clean_count",
|
||||||
mode=NumberMode.SLIDER,
|
mode=NumberMode.SLIDER,
|
||||||
|
@ -109,6 +109,9 @@
|
|||||||
"overheated": {
|
"overheated": {
|
||||||
"name": "Overheated"
|
"name": "Overheated"
|
||||||
},
|
},
|
||||||
|
"overloaded": {
|
||||||
|
"name": "Overloaded"
|
||||||
|
},
|
||||||
"cloud_connection": {
|
"cloud_connection": {
|
||||||
"name": "Cloud connection"
|
"name": "Cloud connection"
|
||||||
},
|
},
|
||||||
@ -268,6 +271,9 @@
|
|||||||
"temperature_offset": {
|
"temperature_offset": {
|
||||||
"name": "Temperature offset"
|
"name": "Temperature offset"
|
||||||
},
|
},
|
||||||
|
"power_protection_threshold": {
|
||||||
|
"name": "Power protection"
|
||||||
|
},
|
||||||
"pan_step": {
|
"pan_step": {
|
||||||
"name": "Pan degrees"
|
"name": "Pan degrees"
|
||||||
},
|
},
|
||||||
|
@ -195,6 +195,11 @@
|
|||||||
"type": "BinarySensor",
|
"type": "BinarySensor",
|
||||||
"category": "Info"
|
"category": "Info"
|
||||||
},
|
},
|
||||||
|
"overloaded": {
|
||||||
|
"value": false,
|
||||||
|
"type": "BinarySensor",
|
||||||
|
"category": "Info"
|
||||||
|
},
|
||||||
"battery_low": {
|
"battery_low": {
|
||||||
"value": false,
|
"value": false,
|
||||||
"type": "BinarySensor",
|
"type": "BinarySensor",
|
||||||
@ -284,6 +289,12 @@
|
|||||||
"minimum_value": -10,
|
"minimum_value": -10,
|
||||||
"maximum_value": 10
|
"maximum_value": 10
|
||||||
},
|
},
|
||||||
|
"power_protection_threshold": {
|
||||||
|
"value": 100,
|
||||||
|
"type": "Number",
|
||||||
|
"category": "Config",
|
||||||
|
"minimum_value": 0
|
||||||
|
},
|
||||||
"target_temperature": {
|
"target_temperature": {
|
||||||
"value": false,
|
"value": false,
|
||||||
"type": "Number",
|
"type": "Number",
|
||||||
|
@ -300,6 +300,53 @@
|
|||||||
'state': 'off',
|
'state': 'off',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_states[binary_sensor.my_device_overloaded-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': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
|
||||||
|
'entity_id': 'binary_sensor.my_device_overloaded',
|
||||||
|
'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': 'Overloaded',
|
||||||
|
'platform': 'tplink',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': 'overloaded',
|
||||||
|
'unique_id': '123456789ABCDEFGH_overloaded',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_states[binary_sensor.my_device_overloaded-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'problem',
|
||||||
|
'friendly_name': 'my_device Overloaded',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'binary_sensor.my_device_overloaded',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'off',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_states[binary_sensor.my_device_temperature_warning-entry]
|
# name: test_states[binary_sensor.my_device_temperature_warning-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
|
@ -145,6 +145,61 @@
|
|||||||
'state': '10',
|
'state': '10',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_states[number.my_device_power_protection-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': dict({
|
||||||
|
'max': 65536,
|
||||||
|
'min': 0,
|
||||||
|
'mode': <NumberMode.SLIDER: 'slider'>,
|
||||||
|
'step': 1.0,
|
||||||
|
}),
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'number',
|
||||||
|
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||||
|
'entity_id': 'number.my_device_power_protection',
|
||||||
|
'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': 'Power protection',
|
||||||
|
'platform': 'tplink',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': 'power_protection_threshold',
|
||||||
|
'unique_id': '123456789ABCDEFGH_power_protection_threshold',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_states[number.my_device_power_protection-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'friendly_name': 'my_device Power protection',
|
||||||
|
'max': 65536,
|
||||||
|
'min': 0,
|
||||||
|
'mode': <NumberMode.SLIDER: 'slider'>,
|
||||||
|
'step': 1.0,
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'number.my_device_power_protection',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': '100',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_states[number.my_device_smooth_off-entry]
|
# name: test_states[number.my_device_smooth_off-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user