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: Set sensor occupancy upon alarm #36

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

hostcc
Copy link
Owner

@hostcc hostcc commented Aug 27, 2024

  • Upon receiving alarm from the device (either via device notifications, or simulated from history) invoke the sensor activity callback to set the sensor occupancy - it helps when device notifications on triggerring sensor's activity aren't receveid by a reason. The occupancy is set only if sensor is known (i.e. alert references the sensor could be found in the list of those retrieved from the device in a cached manner), but only if the state isn't already set (e.g. by another callback).

Please note the change might result in multiple callback invocations for same event - the handlers should be idempotent

* Upon receiving alarm from the device (either via device notifications,
  or simulated from history) invoke the sensor activity callback to set
  the sensor occupancy - it helps when device notifications on
  triggerring sensor's activity aren't receveid by a reason.
  The occupancy is set only if sensor is known (i.e. alert references
  the sensor could be found in the list of those retrieved from the
  device in a cached manner), but only if the state isn't already set
  (e.g. by another callback).

  Please note the change might result in multiple callback invocations
  for same event - the handlers should be idempotent
@hostcc hostcc added the enhancement New feature or request label Aug 27, 2024
@hostcc hostcc self-assigned this Aug 27, 2024
Copy link

sonarcloud bot commented Aug 27, 2024

1 similar comment
Copy link

sonarcloud bot commented Aug 27, 2024

@hostcc hostcc merged commit 2452876 into master Aug 27, 2024
10 checks passed
@hostcc hostcc deleted the feature/simulate-sensor-activity-in-alarm-cb branch August 27, 2024 11:29
hostcc added a commit to hostcc/hass-gs-alarm that referenced this pull request Aug 27, 2024
* `pyg90alarm` has been updated to most recent version, to set occupancy
  of the sensor triggered the alarm. Please see
  hostcc/pyg90alarm#36 for details
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