Remove colon from default entity name in Hue integration (#61118)
parent
97d292133f
commit
9e6e9774d1
|
@ -64,7 +64,7 @@ class HueBaseEntity(Entity):
|
|||
type_title = RESOURCE_TYPE_NAMES.get(
|
||||
self.resource.type, self.resource.type.value.replace("_", " ").title()
|
||||
)
|
||||
return f"{dev_name}: {type_title}"
|
||||
return f"{dev_name} {type_title}"
|
||||
|
||||
async def async_added_to_hass(self) -> None:
|
||||
"""Call when entity is added."""
|
||||
|
|
|
@ -19,7 +19,7 @@ async def test_binary_sensors(hass, mock_bridge_v2, v2_resources_test_data):
|
|||
sensor = hass.states.get("binary_sensor.hue_motion_sensor_motion")
|
||||
assert sensor is not None
|
||||
assert sensor.state == "off"
|
||||
assert sensor.name == "Hue motion sensor: Motion"
|
||||
assert sensor.name == "Hue motion sensor Motion"
|
||||
assert sensor.attributes["device_class"] == "motion"
|
||||
assert sensor.attributes["motion_valid"] is True
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ async def test_sensors(hass, mock_bridge_v2, v2_resources_test_data):
|
|||
sensor = hass.states.get("sensor.hue_motion_sensor_temperature")
|
||||
assert sensor is not None
|
||||
assert sensor.state == "18.1"
|
||||
assert sensor.attributes["friendly_name"] == "Hue motion sensor: Temperature"
|
||||
assert sensor.attributes["friendly_name"] == "Hue motion sensor Temperature"
|
||||
assert sensor.attributes["device_class"] == "temperature"
|
||||
assert sensor.attributes["state_class"] == "measurement"
|
||||
assert sensor.attributes["unit_of_measurement"] == "°C"
|
||||
|
@ -32,7 +32,7 @@ async def test_sensors(hass, mock_bridge_v2, v2_resources_test_data):
|
|||
sensor = hass.states.get("sensor.hue_motion_sensor_illuminance")
|
||||
assert sensor is not None
|
||||
assert sensor.state == "63"
|
||||
assert sensor.attributes["friendly_name"] == "Hue motion sensor: Illuminance"
|
||||
assert sensor.attributes["friendly_name"] == "Hue motion sensor Illuminance"
|
||||
assert sensor.attributes["device_class"] == "illuminance"
|
||||
assert sensor.attributes["state_class"] == "measurement"
|
||||
assert sensor.attributes["unit_of_measurement"] == "lx"
|
||||
|
@ -43,7 +43,7 @@ async def test_sensors(hass, mock_bridge_v2, v2_resources_test_data):
|
|||
sensor = hass.states.get("sensor.wall_switch_with_2_controls_battery")
|
||||
assert sensor is not None
|
||||
assert sensor.state == "100"
|
||||
assert sensor.attributes["friendly_name"] == "Wall switch with 2 controls: Battery"
|
||||
assert sensor.attributes["friendly_name"] == "Wall switch with 2 controls Battery"
|
||||
assert sensor.attributes["device_class"] == "battery"
|
||||
assert sensor.attributes["state_class"] == "measurement"
|
||||
assert sensor.attributes["unit_of_measurement"] == "%"
|
||||
|
|
|
@ -17,7 +17,7 @@ async def test_switch(hass, mock_bridge_v2, v2_resources_test_data):
|
|||
# test config switch to enable/disable motion sensor
|
||||
test_entity = hass.states.get("switch.hue_motion_sensor_motion")
|
||||
assert test_entity is not None
|
||||
assert test_entity.name == "Hue motion sensor: Motion"
|
||||
assert test_entity.name == "Hue motion sensor Motion"
|
||||
assert test_entity.state == "on"
|
||||
assert test_entity.attributes["device_class"] == "switch"
|
||||
|
||||
|
|
Loading…
Reference in New Issue