Skip to content

Commit

Permalink
Address yale review comments part 2 (#124887)
Browse files Browse the repository at this point in the history
* Remove some unneeded block till done

* Additional state check cleanups and snapshots

* Use more snapshots in yale tests
  • Loading branch information
bdraco authored and bramkragten committed Aug 30, 2024
1 parent 8668af1 commit 533c8ca
Show file tree
Hide file tree
Showing 5 changed files with 226 additions and 206 deletions.
37 changes: 37 additions & 0 deletions tests/components/yale/snapshots/test_lock.ambr
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# serializer version: 1
# name: test_lock_device_registry
DeviceRegistryEntrySnapshot({
'area_id': 'online_with_doorsense_name',
'config_entries': <ANY>,
'configuration_url': 'https://account.aaecosystem.com',
'connections': set({
tuple(
'bluetooth',
'12:22',
),
}),
'disabled_by': None,
'entry_type': None,
'hw_version': None,
'id': <ANY>,
'identifiers': set({
tuple(
'yale',
'online_with_doorsense',
),
}),
'is_new': False,
'labels': set({
}),
'manufacturer': 'Yale Home Inc.',
'model': 'AUG-MD01',
'model_id': None,
'name': 'online_with_doorsense Name',
'name_by_user': None,
'primary_config_entry': <ANY>,
'serial_number': None,
'suggested_area': 'online_with_doorsense Name',
'sw_version': 'undefined-4.3.0-1.8.14',
'via_device_id': None,
})
# ---
95 changes: 95 additions & 0 deletions tests/components/yale/snapshots/test_sensor.ambr
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# serializer version: 1
# name: test_lock_operator_autorelock
ReadOnlyDict({
'autorelock': True,
'friendly_name': 'online_with_doorsense Name Operator',
'keypad': False,
'manual': False,
'method': 'autorelock',
'remote': False,
'tag': False,
})
# ---
# name: test_lock_operator_keypad
ReadOnlyDict({
'autorelock': False,
'friendly_name': 'online_with_doorsense Name Operator',
'keypad': True,
'manual': False,
'method': 'keypad',
'remote': False,
'tag': False,
})
# ---
# name: test_lock_operator_manual
ReadOnlyDict({
'autorelock': False,
'friendly_name': 'online_with_doorsense Name Operator',
'keypad': False,
'manual': True,
'method': 'manual',
'remote': False,
'tag': False,
})
# ---
# name: test_lock_operator_remote
ReadOnlyDict({
'autorelock': False,
'friendly_name': 'online_with_doorsense Name Operator',
'keypad': False,
'manual': False,
'method': 'remote',
'remote': True,
'tag': False,
})
# ---
# name: test_restored_state
StateSnapshot({
'attributes': ReadOnlyDict({
'autorelock': False,
'entity_picture': 'image.png',
'friendly_name': 'online_with_doorsense Name Operator',
'keypad': False,
'manual': False,
'method': 'tag',
'remote': False,
'tag': True,
}),
'context': <ANY>,
'entity_id': 'sensor.online_with_doorsense_name_operator',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'Tag Unlock',
})
# ---
# name: test_unlock_operator_manual
StateSnapshot({
'attributes': ReadOnlyDict({
'autorelock': False,
'friendly_name': 'online_with_doorsense Name Operator',
'keypad': False,
'manual': True,
'method': 'manual',
'remote': False,
'tag': False,
}),
'context': <ANY>,
'entity_id': 'sensor.online_with_doorsense_name_operator',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'Your favorite elven princess',
})
# ---
# name: test_unlock_operator_tag
ReadOnlyDict({
'autorelock': False,
'friendly_name': 'online_with_doorsense Name Operator',
'keypad': False,
'manual': False,
'method': 'tag',
'remote': False,
'tag': True,
})
# ---
1 change: 0 additions & 1 deletion tests/components/yale/test_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ async def test_wake_lock(hass: HomeAssistant) -> None:
await hass.services.async_call(
BUTTON_DOMAIN, SERVICE_PRESS, {ATTR_ENTITY_ID: entity_id}, blocking=True
)
await hass.async_block_till_done()
api_instance.async_status_async.assert_called_once()
Loading

0 comments on commit 533c8ca

Please sign in to comment.