mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 06:47:09 +00:00
Door entity as enum sensor at Home Connect (#126158)
This commit is contained in:
parent
d8ec0103a9
commit
a948c7d69d
@ -61,6 +61,14 @@
|
|||||||
"aborting": "mdi:close-circle"
|
"aborting": "mdi:close-circle"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"door": {
|
||||||
|
"default": "mdi:door",
|
||||||
|
"state": {
|
||||||
|
"closed": "mdi:door-closed",
|
||||||
|
"locked": "mdi:door-closed-lock",
|
||||||
|
"open": "mdi:door-open"
|
||||||
|
}
|
||||||
|
},
|
||||||
"program_progress": {
|
"program_progress": {
|
||||||
"default": "mdi:progress-clock"
|
"default": "mdi:progress-clock"
|
||||||
},
|
},
|
||||||
|
@ -24,6 +24,7 @@ import homeassistant.util.dt as dt_util
|
|||||||
from .api import ConfigEntryAuth
|
from .api import ConfigEntryAuth
|
||||||
from .const import (
|
from .const import (
|
||||||
ATTR_VALUE,
|
ATTR_VALUE,
|
||||||
|
BSH_DOOR_STATE,
|
||||||
BSH_OPERATION_STATE,
|
BSH_OPERATION_STATE,
|
||||||
BSH_OPERATION_STATE_FINISHED,
|
BSH_OPERATION_STATE_FINISHED,
|
||||||
BSH_OPERATION_STATE_PAUSE,
|
BSH_OPERATION_STATE_PAUSE,
|
||||||
@ -91,6 +92,16 @@ SENSORS = (
|
|||||||
],
|
],
|
||||||
translation_key="operation_state",
|
translation_key="operation_state",
|
||||||
),
|
),
|
||||||
|
HomeConnectSensorEntityDescription(
|
||||||
|
key=BSH_DOOR_STATE,
|
||||||
|
device_class=SensorDeviceClass.ENUM,
|
||||||
|
options=[
|
||||||
|
"closed",
|
||||||
|
"locked",
|
||||||
|
"open",
|
||||||
|
],
|
||||||
|
translation_key="door",
|
||||||
|
),
|
||||||
HomeConnectSensorEntityDescription(
|
HomeConnectSensorEntityDescription(
|
||||||
key="ConsumerProducts.CoffeeMaker.Status.BeverageCounterCoffee",
|
key="ConsumerProducts.CoffeeMaker.Status.BeverageCounterCoffee",
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
@ -209,6 +209,14 @@
|
|||||||
"aborting": "Aborting"
|
"aborting": "Aborting"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"door": {
|
||||||
|
"name": "Door",
|
||||||
|
"state": {
|
||||||
|
"closed": "[%key:common::state::closed%]",
|
||||||
|
"locked": "[%key:common::state::locked%]",
|
||||||
|
"open": "[%key:common::state::open%]"
|
||||||
|
}
|
||||||
|
},
|
||||||
"coffee_counter": {
|
"coffee_counter": {
|
||||||
"name": "Coffees"
|
"name": "Coffees"
|
||||||
},
|
},
|
||||||
|
@ -8,6 +8,10 @@ from homeconnect.api import HomeConnectAPI
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from homeassistant.components.home_connect.const import (
|
from homeassistant.components.home_connect.const import (
|
||||||
|
BSH_DOOR_STATE,
|
||||||
|
BSH_DOOR_STATE_CLOSED,
|
||||||
|
BSH_DOOR_STATE_LOCKED,
|
||||||
|
BSH_DOOR_STATE_OPEN,
|
||||||
BSH_EVENT_PRESENT_STATE_CONFIRMED,
|
BSH_EVENT_PRESENT_STATE_CONFIRMED,
|
||||||
BSH_EVENT_PRESENT_STATE_OFF,
|
BSH_EVENT_PRESENT_STATE_OFF,
|
||||||
BSH_EVENT_PRESENT_STATE_PRESENT,
|
BSH_EVENT_PRESENT_STATE_PRESENT,
|
||||||
@ -224,6 +228,27 @@ async def test_remaining_prog_time_edge_cases(
|
|||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
("entity_id", "status_key", "event_value_update", "expected", "appliance"),
|
("entity_id", "status_key", "event_value_update", "expected", "appliance"),
|
||||||
[
|
[
|
||||||
|
(
|
||||||
|
"sensor.dishwasher_door",
|
||||||
|
BSH_DOOR_STATE,
|
||||||
|
BSH_DOOR_STATE_LOCKED,
|
||||||
|
"locked",
|
||||||
|
"Dishwasher",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"sensor.dishwasher_door",
|
||||||
|
BSH_DOOR_STATE,
|
||||||
|
BSH_DOOR_STATE_CLOSED,
|
||||||
|
"closed",
|
||||||
|
"Dishwasher",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"sensor.dishwasher_door",
|
||||||
|
BSH_DOOR_STATE,
|
||||||
|
BSH_DOOR_STATE_OPEN,
|
||||||
|
"open",
|
||||||
|
"Dishwasher",
|
||||||
|
),
|
||||||
(
|
(
|
||||||
"sensor.fridgefreezer_freezer_door_alarm",
|
"sensor.fridgefreezer_freezer_door_alarm",
|
||||||
"EVENT_NOT_IN_STATUS_YET_SO_SET_TO_OFF",
|
"EVENT_NOT_IN_STATUS_YET_SO_SET_TO_OFF",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user