mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 06:37:52 +00:00
Improve translation_key of EnergyEvseSupplyStateSensor
in matter
(#148280)
This commit is contained in:
parent
0bce01da0b
commit
21f6bf3914
@ -309,7 +309,7 @@ DISCOVERY_SCHEMAS = [
|
|||||||
platform=Platform.BINARY_SENSOR,
|
platform=Platform.BINARY_SENSOR,
|
||||||
entity_description=MatterBinarySensorEntityDescription(
|
entity_description=MatterBinarySensorEntityDescription(
|
||||||
key="EnergyEvseSupplyStateSensor",
|
key="EnergyEvseSupplyStateSensor",
|
||||||
translation_key="evse_supply_charging_state",
|
translation_key="evse_supply_state",
|
||||||
device_class=BinarySensorDeviceClass.RUNNING,
|
device_class=BinarySensorDeviceClass.RUNNING,
|
||||||
device_to_ha={
|
device_to_ha={
|
||||||
clusters.EnergyEvse.Enums.SupplyStateEnum.kDisabled: False,
|
clusters.EnergyEvse.Enums.SupplyStateEnum.kDisabled: False,
|
||||||
|
@ -83,8 +83,8 @@
|
|||||||
"evse_plug": {
|
"evse_plug": {
|
||||||
"name": "Plug state"
|
"name": "Plug state"
|
||||||
},
|
},
|
||||||
"evse_supply_charging_state": {
|
"evse_supply_state": {
|
||||||
"name": "Supply charging state"
|
"name": "Charger supply state"
|
||||||
},
|
},
|
||||||
"boost_state": {
|
"boost_state": {
|
||||||
"name": "Boost state"
|
"name": "Boost state"
|
||||||
|
@ -685,7 +685,7 @@
|
|||||||
'state': 'on',
|
'state': 'on',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_binary_sensors[silabs_evse_charging][binary_sensor.evse_supply_charging_state-entry]
|
# name: test_binary_sensors[silabs_evse_charging][binary_sensor.evse_charger_supply_state-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
}),
|
}),
|
||||||
@ -698,7 +698,7 @@
|
|||||||
'disabled_by': None,
|
'disabled_by': None,
|
||||||
'domain': 'binary_sensor',
|
'domain': 'binary_sensor',
|
||||||
'entity_category': None,
|
'entity_category': None,
|
||||||
'entity_id': 'binary_sensor.evse_supply_charging_state',
|
'entity_id': 'binary_sensor.evse_charger_supply_state',
|
||||||
'has_entity_name': True,
|
'has_entity_name': True,
|
||||||
'hidden_by': None,
|
'hidden_by': None,
|
||||||
'icon': None,
|
'icon': None,
|
||||||
@ -710,24 +710,24 @@
|
|||||||
}),
|
}),
|
||||||
'original_device_class': <BinarySensorDeviceClass.RUNNING: 'running'>,
|
'original_device_class': <BinarySensorDeviceClass.RUNNING: 'running'>,
|
||||||
'original_icon': None,
|
'original_icon': None,
|
||||||
'original_name': 'Supply charging state',
|
'original_name': 'Charger supply state',
|
||||||
'platform': 'matter',
|
'platform': 'matter',
|
||||||
'previous_unique_id': None,
|
'previous_unique_id': None,
|
||||||
'suggested_object_id': None,
|
'suggested_object_id': None,
|
||||||
'supported_features': 0,
|
'supported_features': 0,
|
||||||
'translation_key': 'evse_supply_charging_state',
|
'translation_key': 'evse_supply_state',
|
||||||
'unique_id': '00000000000004D2-0000000000000017-MatterNodeDevice-1-EnergyEvseSupplyStateSensor-153-1',
|
'unique_id': '00000000000004D2-0000000000000017-MatterNodeDevice-1-EnergyEvseSupplyStateSensor-153-1',
|
||||||
'unit_of_measurement': None,
|
'unit_of_measurement': None,
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_binary_sensors[silabs_evse_charging][binary_sensor.evse_supply_charging_state-state]
|
# name: test_binary_sensors[silabs_evse_charging][binary_sensor.evse_charger_supply_state-state]
|
||||||
StateSnapshot({
|
StateSnapshot({
|
||||||
'attributes': ReadOnlyDict({
|
'attributes': ReadOnlyDict({
|
||||||
'device_class': 'running',
|
'device_class': 'running',
|
||||||
'friendly_name': 'evse Supply charging state',
|
'friendly_name': 'evse Charger supply state',
|
||||||
}),
|
}),
|
||||||
'context': <ANY>,
|
'context': <ANY>,
|
||||||
'entity_id': 'binary_sensor.evse_supply_charging_state',
|
'entity_id': 'binary_sensor.evse_charger_supply_state',
|
||||||
'last_changed': <ANY>,
|
'last_changed': <ANY>,
|
||||||
'last_reported': <ANY>,
|
'last_reported': <ANY>,
|
||||||
'last_updated': <ANY>,
|
'last_updated': <ANY>,
|
||||||
|
@ -184,8 +184,8 @@ async def test_evse_sensor(
|
|||||||
assert state
|
assert state
|
||||||
assert state.state == "off"
|
assert state.state == "off"
|
||||||
|
|
||||||
# Test SupplyStateEnum value with binary_sensor.evse_supply_charging
|
# Test SupplyStateEnum value with binary_sensor.evse_charger_supply_state
|
||||||
entity_id = "binary_sensor.evse_supply_charging_state"
|
entity_id = "binary_sensor.evse_charger_supply_state"
|
||||||
state = hass.states.get(entity_id)
|
state = hass.states.get(entity_id)
|
||||||
assert state
|
assert state
|
||||||
assert state.state == "on"
|
assert state.state == "on"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user