Switch to new entity naming schema across zwave_js (#77434)

This commit is contained in:
Raman Gupta
2022-09-12 09:14:59 +02:00
committed by GitHub
parent b56f54745a
commit abebf3c067
9 changed files with 43 additions and 61 deletions
+3 -7
View File
@@ -1,9 +1,7 @@
"""Provide common test tools for Z-Wave JS."""
AIR_TEMPERATURE_SENSOR = "sensor.multisensor_6_air_temperature"
BATTERY_SENSOR = "sensor.multisensor_6_battery_level"
TAMPER_SENSOR = (
"binary_sensor.multisensor_6_home_security_tampering_product_cover_removed"
)
TAMPER_SENSOR = "binary_sensor.multisensor_6_tampering_product_cover_removed"
HUMIDITY_SENSOR = "sensor.multisensor_6_humidity"
POWER_SENSOR = "sensor.smart_plug_with_two_usb_ports_value_electric_consumed"
ENERGY_SENSOR = "sensor.smart_plug_with_two_usb_ports_value_electric_consumed_2"
@@ -13,10 +11,8 @@ SWITCH_ENTITY = "switch.smart_plug_with_two_usb_ports"
LOW_BATTERY_BINARY_SENSOR = "binary_sensor.multisensor_6_low_battery_level"
ENABLED_LEGACY_BINARY_SENSOR = "binary_sensor.z_wave_door_window_sensor_any"
DISABLED_LEGACY_BINARY_SENSOR = "binary_sensor.multisensor_6_any"
NOTIFICATION_MOTION_BINARY_SENSOR = (
"binary_sensor.multisensor_6_home_security_motion_detection"
)
NOTIFICATION_MOTION_SENSOR = "sensor.multisensor_6_home_security_motion_sensor_status"
NOTIFICATION_MOTION_BINARY_SENSOR = "binary_sensor.multisensor_6_motion_detection"
NOTIFICATION_MOTION_SENSOR = "sensor.multisensor_6_motion_sensor_status"
INDICATOR_SENSOR = "sensor.z_wave_thermostat_indicator_value"
BASIC_NUMBER_ENTITY = "number.livingroomlight_basic"
PROPERTY_DOOR_STATUS_BINARY_SENSOR = (
@@ -141,7 +141,7 @@ async def test_notification_off_state(
state = door_states[0]
assert state
assert state.entity_id == "binary_sensor.node_62_access_control_window_door_is_open"
assert state.entity_id == "binary_sensor.node_62_window_door_is_open"
async def test_property_sensor_door_status(hass, lock_august_pro, integration):
+6 -8
View File
@@ -347,10 +347,10 @@ async def test_existing_node_not_replaced_when_not_ready(
assert not device.area_id
assert device == dev_reg.async_get_device(identifiers={(DOMAIN, device_id_ext)})
motion_entity = "binary_sensor.4_in_1_sensor_home_security_motion_detection"
motion_entity = "binary_sensor.4_in_1_sensor_motion_detection"
state = hass.states.get(motion_entity)
assert state
assert state.name == "4-in-1 Sensor: Home Security - Motion detection"
assert state.name == "4-in-1 Sensor Motion detection"
dev_reg.async_update_device(
device.id, name_by_user="Custom Device Name", area_id=kitchen_area.id
@@ -1179,10 +1179,10 @@ async def test_node_model_change(hass, zp3111, client, integration):
dev_id = device.id
motion_entity = "binary_sensor.4_in_1_sensor_home_security_motion_detection"
motion_entity = "binary_sensor.4_in_1_sensor_motion_detection"
state = hass.states.get(motion_entity)
assert state
assert state.name == "4-in-1 Sensor: Home Security - Motion detection"
assert state.name == "4-in-1 Sensor Motion detection"
# Customize device and entity names/ids
dev_reg.async_update_device(device.id, name_by_user="Custom Device Name")
@@ -1267,7 +1267,7 @@ async def test_disabled_entity_on_value_removed(hass, zp3111, client, integratio
er_reg = er.async_get(hass)
# re-enable this default-disabled entity
sensor_cover_entity = "sensor.4_in_1_sensor_home_security_cover_status"
sensor_cover_entity = "sensor.4_in_1_sensor_cover_status"
er_reg.async_update_entity(entity_id=sensor_cover_entity, disabled_by=None)
await hass.async_block_till_done()
@@ -1285,9 +1285,7 @@ async def test_disabled_entity_on_value_removed(hass, zp3111, client, integratio
assert state.state != STATE_UNAVAILABLE
# check for expected entities
binary_cover_entity = (
"binary_sensor.4_in_1_sensor_home_security_tampering_product_cover_removed"
)
binary_cover_entity = "binary_sensor.4_in_1_sensor_tampering_product_cover_removed"
state = hass.states.get(binary_cover_entity)
assert state
assert state.state != STATE_UNAVAILABLE