Add sensor, selector and switch for Plugwise Anna + Loria combination (#80558)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Bouwe Westerdijk 2022-10-19 11:26:27 +02:00 committed by GitHub
parent eca21ceff0
commit 0c8884fd51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 47 additions and 8 deletions

View File

@ -54,6 +54,16 @@ SELECT_TYPES = (
options_key="regulation_modes",
device_class="plugwise__regulation_mode",
),
PlugwiseSelectEntityDescription(
key="select_dhw_mode",
name="DHW mode",
icon="mdi:shower",
entity_category=EntityCategory.CONFIG,
command=lambda api, loc, opt: api.set_dhw_mode(opt),
current_option_key="dhw_mode",
options_key="dhw_modes",
device_class="plugwise__dhw_mode",
),
)

View File

@ -263,6 +263,13 @@ SENSORS: tuple[SensorEntityDescription, ...] = (
device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
),
SensorEntityDescription(
key="dhw_temperature",
name="DHW temperature",
native_unit_of_measurement=TEMP_CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
)

View File

@ -6,6 +6,12 @@
"cooling": "Cooling",
"heating": "Heating",
"off": "Off"
},
"plugwise__dhw_mode": {
"off": "Off",
"auto": "Auto",
"boost": "Boost",
"comfort": "Comfort"
}
}
}

View File

@ -36,6 +36,12 @@ SWITCHES: tuple[SwitchEntityDescription, ...] = (
name="Relay",
device_class=SwitchDeviceClass.SWITCH,
),
SwitchEntityDescription(
key="cooling_ena_switch",
name="Cooling",
icon="mdi:snowflake-thermometer",
entity_category=EntityCategory.CONFIG,
),
)

View File

@ -1,11 +1,17 @@
{
"state": {
"plugwise__regulation_mode": {
"bleeding_cold": "Bleeding cold",
"bleeding_hot": "Bleeding hot",
"cooling": "Cooling",
"heating": "Heating",
"off": "Off"
}
"plugwise__regulation_mode": {
"bleeding_cold": "Bleeding cold",
"bleeding_hot": "Bleeding hot",
"cooling": "Cooling",
"heating": "Heating",
"off": "Off"
},
"plugwise__dhw_mode": {
"off": "Off",
"auto": "Auto",
"boost": "Boost",
"comfort": "Comfort"
}
}
}
}

View File

@ -47,6 +47,10 @@ async def test_anna_as_smt_climate_sensor_entities(
assert state
assert float(state.state) == 29.1
state = hass.states.get("sensor.opentherm_dhw_temperature")
assert state
assert float(state.state) == 46.3
state = hass.states.get("sensor.anna_illuminance")
assert state
assert float(state.state) == 86.0