mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 17:27:52 +00:00
Make sure that vocolinc flowerbud humidity sensor is exposed (via homekit_controller) (#53518)
* Make sure that vocolinc flowerbud humidity sensor is exposed * Was a no-op to request these from humidifier, so remove them * Fix typo
This commit is contained in:
parent
ee452d415d
commit
1681bbe5a5
@ -49,4 +49,7 @@ CHARACTERISTIC_PLATFORMS = {
|
||||
CharacteristicsTypes.Vendor.KOOGEEK_REALTIME_ENERGY_2: "sensor",
|
||||
CharacteristicsTypes.Vendor.VOCOLINC_HUMIDIFIER_SPRAY_LEVEL: "number",
|
||||
CharacteristicsTypes.get_uuid(CharacteristicsTypes.TEMPERATURE_CURRENT): "sensor",
|
||||
CharacteristicsTypes.get_uuid(
|
||||
CharacteristicsTypes.RELATIVE_HUMIDITY_CURRENT
|
||||
): "sensor",
|
||||
}
|
||||
|
@ -41,7 +41,6 @@ class HomeKitHumidifier(HomeKitEntity, HumidifierEntity):
|
||||
"""Define the homekit characteristics the entity cares about."""
|
||||
return [
|
||||
CharacteristicsTypes.ACTIVE,
|
||||
CharacteristicsTypes.RELATIVE_HUMIDITY_CURRENT,
|
||||
CharacteristicsTypes.CURRENT_HUMIDIFIER_DEHUMIDIFIER_STATE,
|
||||
CharacteristicsTypes.TARGET_HUMIDIFIER_DEHUMIDIFIER_STATE,
|
||||
CharacteristicsTypes.RELATIVE_HUMIDITY_HUMIDIFIER_THRESHOLD,
|
||||
@ -143,7 +142,6 @@ class HomeKitDehumidifier(HomeKitEntity, HumidifierEntity):
|
||||
"""Define the homekit characteristics the entity cares about."""
|
||||
return [
|
||||
CharacteristicsTypes.ACTIVE,
|
||||
CharacteristicsTypes.RELATIVE_HUMIDITY_CURRENT,
|
||||
CharacteristicsTypes.CURRENT_HUMIDIFIER_DEHUMIDIFIER_STATE,
|
||||
CharacteristicsTypes.TARGET_HUMIDIFIER_DEHUMIDIFIER_STATE,
|
||||
CharacteristicsTypes.RELATIVE_HUMIDITY_HUMIDIFIER_THRESHOLD,
|
||||
|
@ -53,6 +53,16 @@ SIMPLE_SENSOR = {
|
||||
"probe": lambda char: char.service.type
|
||||
!= ServicesTypes.get_uuid(ServicesTypes.TEMPERATURE_SENSOR),
|
||||
},
|
||||
CharacteristicsTypes.get_uuid(CharacteristicsTypes.RELATIVE_HUMIDITY_CURRENT): {
|
||||
"name": "Current Humidity",
|
||||
"device_class": DEVICE_CLASS_HUMIDITY,
|
||||
"state_class": STATE_CLASS_MEASUREMENT,
|
||||
"unit": PERCENTAGE,
|
||||
# This sensor is only for humidity characteristics that are not part
|
||||
# of a humidity sensor service.
|
||||
"probe": lambda char: char.service.type
|
||||
!= ServicesTypes.get_uuid(ServicesTypes.HUMIDITY_SENSOR),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
@ -68,3 +68,25 @@ async def test_vocolinc_flowerbud_setup(hass):
|
||||
|
||||
# The sensor and switch should be part of the same device
|
||||
assert entry.device_id == device.id
|
||||
|
||||
# Assert the humidity sensory is detected
|
||||
entry = entity_registry.async_get(
|
||||
"sensor.vocolinc_flowerbud_0d324b_current_humidity"
|
||||
)
|
||||
assert entry.unique_id == "homekit-AM01121849000327-aid:1-sid:30-cid:30"
|
||||
|
||||
helper = Helper(
|
||||
hass,
|
||||
"sensor.vocolinc_flowerbud_0d324b_current_humidity",
|
||||
pairing,
|
||||
accessories[0],
|
||||
config_entry,
|
||||
)
|
||||
state = await helper.poll_and_get_state()
|
||||
assert (
|
||||
state.attributes["friendly_name"]
|
||||
== "VOCOlinc-Flowerbud-0d324b - Current Humidity"
|
||||
)
|
||||
|
||||
# The sensor and humidifier should be part of the same device
|
||||
assert entry.device_id == device.id
|
||||
|
Loading…
x
Reference in New Issue
Block a user