Remove colon from default entity name in Hue integration (#61118)

pull/61136/head
Marcel van der Veldt 2021-12-07 00:17:17 +01:00 committed by GitHub
parent 97d292133f
commit 9e6e9774d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View File

@ -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."""

View File

@ -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

View File

@ -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"] == "%"

View File

@ -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"