mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Name sensors correctly (#23208)
* Hue motion senors are motion sensors, not presence sensors. * Name the sensors 'motion' instead of 'presence' - match the HA paradigm.
This commit is contained in:
parent
e7054e0fd2
commit
c899e2a662
@ -5,7 +5,7 @@ from homeassistant.components.hue.sensor_base import (
|
|||||||
GenericZLLSensor, async_setup_entry as shared_async_setup_entry)
|
GenericZLLSensor, async_setup_entry as shared_async_setup_entry)
|
||||||
|
|
||||||
|
|
||||||
PRESENCE_NAME_FORMAT = "{} presence"
|
PRESENCE_NAME_FORMAT = "{} motion"
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(hass, config_entry, async_add_entities):
|
async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||||
|
@ -391,7 +391,7 @@ async def test_sensors(hass, mock_bridge):
|
|||||||
assert len(hass.states.async_all()) == 6
|
assert len(hass.states.async_all()) == 6
|
||||||
|
|
||||||
presence_sensor_1 = hass.states.get(
|
presence_sensor_1 = hass.states.get(
|
||||||
'binary_sensor.living_room_sensor_presence')
|
'binary_sensor.living_room_sensor_motion')
|
||||||
light_level_sensor_1 = hass.states.get(
|
light_level_sensor_1 = hass.states.get(
|
||||||
'sensor.living_room_sensor_light_level')
|
'sensor.living_room_sensor_light_level')
|
||||||
temperature_sensor_1 = hass.states.get(
|
temperature_sensor_1 = hass.states.get(
|
||||||
@ -406,7 +406,7 @@ async def test_sensors(hass, mock_bridge):
|
|||||||
assert temperature_sensor_1.name == 'Living room sensor temperature'
|
assert temperature_sensor_1.name == 'Living room sensor temperature'
|
||||||
|
|
||||||
presence_sensor_2 = hass.states.get(
|
presence_sensor_2 = hass.states.get(
|
||||||
'binary_sensor.kitchen_sensor_presence')
|
'binary_sensor.kitchen_sensor_motion')
|
||||||
light_level_sensor_2 = hass.states.get(
|
light_level_sensor_2 = hass.states.get(
|
||||||
'sensor.kitchen_sensor_light_level')
|
'sensor.kitchen_sensor_light_level')
|
||||||
temperature_sensor_2 = hass.states.get(
|
temperature_sensor_2 = hass.states.get(
|
||||||
@ -459,7 +459,7 @@ async def test_new_sensor_discovered(hass, mock_bridge):
|
|||||||
assert len(mock_bridge.mock_requests) == 2
|
assert len(mock_bridge.mock_requests) == 2
|
||||||
assert len(hass.states.async_all()) == 9
|
assert len(hass.states.async_all()) == 9
|
||||||
|
|
||||||
presence = hass.states.get('binary_sensor.bedroom_sensor_presence')
|
presence = hass.states.get('binary_sensor.bedroom_sensor_motion')
|
||||||
assert presence is not None
|
assert presence is not None
|
||||||
assert presence.state == 'on'
|
assert presence.state == 'on'
|
||||||
temperature = hass.states.get('sensor.bedroom_sensor_temperature')
|
temperature = hass.states.get('sensor.bedroom_sensor_temperature')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user