mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 04:50:05 +00:00
Handle capitalized HomeKit property names (#21382)
The Velux ACTIVE gateway uses `C#` rather than `c#` as the name of the property that holds the count of accessories. Apple's HomeKit docs suggest that properties should be case-insensitive, so update the code to not assume the property names are lower case.
This commit is contained in:
@@ -70,6 +70,20 @@ def create_window_covering_service_with_v_tilt():
|
||||
return service
|
||||
|
||||
|
||||
async def test_accept_capitalized_property_names(hass, utcnow):
|
||||
"""Test that we can handle a device with capitalized property names."""
|
||||
window_cover = create_window_covering_service()
|
||||
helper = await setup_test_component(hass, [window_cover], capitalize=True)
|
||||
|
||||
# The specific interaction we do here doesn't matter; we just need
|
||||
# to do *something* to ensure that discovery properly dealt with the
|
||||
# capitalized property names.
|
||||
await hass.services.async_call('cover', 'open_cover', {
|
||||
'entity_id': helper.entity_id,
|
||||
}, blocking=True)
|
||||
assert helper.characteristics[POSITION_TARGET].value == 100
|
||||
|
||||
|
||||
async def test_change_window_cover_state(hass, utcnow):
|
||||
"""Test that we can turn a HomeKit alarm on and off again."""
|
||||
window_cover = create_window_covering_service()
|
||||
|
||||
Reference in New Issue
Block a user