Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added support for updating sensor/device lists w/o reinstantiating G90Alarm #52

Merged
merged 2 commits into from
Jan 19, 2025

Conversation

hostcc
Copy link
Owner

@hostcc hostcc commented Jan 19, 2025

  • G90Alarm.get_sensors() and G90Alarm.get_devices() methods now fetch sensor and devices lists from the panel, without need to reinstantiate G90Alarm. The lists are stable, i.e. entities no longer in the panel are still retained but marked as unavailable (.is_unavailable property on them will return False). This functionality also differs from the previous versions, as those methods were caching the lists upon first retrieval, while now those are fetched upon each call to the methods.
  • G90Alarm.sensors and G90Alarm.devices properties now return cached version of sensor and device lists, unless those are empty - then the properties will internall fetch those (via methods above, respectively).
  • Introduced G90BaseEntity, G90BaseList, G90SensorList and G90DeviceList classes to support the above functionality.

…ing `G90Alarm`

* `G90Alarm.get_sensors()` and `G90Alarm.get_devices()` methods now fetch
  sensor and devices lists from the panel, without need to reinstantiate `G90Alarm`.
  The lists are stable, i.e. entities no longer in the panel are still retained
  but marked as unavailable (`.is_unavailable` property on them will return `False`).
  This functionality also differs from the previous versions, as those methods were
  caching the lists upon first retrieval, while now those are fetched upon each call to the methods.
* `G90Alarm.sensors` and `G90Alarm.devices` properties now return cached version of sensor and device
  lists, unless those are empty - then the properties will internall fetch those
  (via methods above, respectively).
+ Introduced `G90BaseEntity`, `G90BaseList`, `G90SensorList` and `G90DeviceList`
  classes to support the above functionality.
@hostcc hostcc added the enhancement New feature or request label Jan 19, 2025
@hostcc hostcc self-assigned this Jan 19, 2025
  parameter `exclude_unavailable` to exclude unavailable entities from the search
  (`G90Alarm.find_sensor()`` defaults that to true)
* Added a test for `G90Alarm.find_sensor()` to verify the new parameter
  works as expected
* Spelling fixes
@hostcc hostcc merged commit 640c6ea into master Jan 19, 2025
11 checks passed
@hostcc hostcc deleted the feat/sensor-device-list-update branch January 19, 2025 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant