Skip to content

Commit

Permalink
Code review #3
Browse files Browse the repository at this point in the history
Signed-off-by: Gaël L'hopital <[email protected]>
  • Loading branch information
clinique committed Nov 1, 2024
1 parent 5ae6034 commit 9f5740b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
26 changes: 13 additions & 13 deletions bundles/org.openhab.binding.netatmo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -649,19 +649,19 @@ Person things are automatically created in discovery process for all known perso

**Supported channels for the Person thing:**

| Channel Group | Channel ID | Item Type | Description |
| -------------- | ------------ | --------- | ------------------------------------------------------------------------ |
| security-event | home-event | | Trigger channel which is triggered an event for this person is triggered |
| person | avatar-url | String | URL for the avatar of this person |
| person | avatar | Image | Avatar of this person |
| person | at-home | Switch | Indicates if this person is known to be at home or not |
| person | last-seen | DateTime | Moment when this person was last seen |
| last-event | subtype | String | Sub-type of event |
| last-event | message | String | Last event message from this person |
| last-event | time | DateTime | Moment of the last event for this person |
| last-event | snapshot | Image | Picture of the last event for this person |
| last-event | snapshot-url | String | URL for the picture of the last event for this person |
| last-event | camera-id | String | ID of the camera that triggered the event |
| Channel Group | Channel ID | Item Type | Description |
| -------------- | ------------ | --------- | ------------------------------------------------------------------------------------------------- |
| security-event | home-event | | Trigger channel which is triggered by an event for this person (PERSON, PERSON_AWAY, PERSON_HOME) |
| person | avatar-url | String | URL for the avatar of this person |
| person | avatar | Image | Avatar of this person |
| person | at-home | Switch | Indicates if this person is known to be at home or not |
| person | last-seen | DateTime | Moment when this person was last seen |
| last-event | subtype | String | Sub-type of event |
| last-event | message | String | Last event message from this person |
| last-event | time | DateTime | Moment of the last event for this person |
| last-event | snapshot | Image | Picture of the last event for this person |
| last-event | snapshot-url | String | URL for the picture of the last event for this person |
| last-event | camera-id | String | ID of the camera that triggered the event |

All these channels except at-home are read only.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,12 @@ public class Capability {

if (newData instanceof HomeEvent homeEvent) {
updateHomeEvent(homeEvent);
} else if (newData instanceof WebhookEvent webhookEvent
&& webhookEvent.getEventType().validFor(moduleType)) {
updateWebhookEvent(webhookEvent);
} else if (newData instanceof WebhookEvent webhookEvent) {
if (webhookEvent.getEventType().validFor(moduleType)) {
updateWebhookEvent(webhookEvent);
} else {
// dropped
}
} else if (newData instanceof Event event) {
updateEvent(event);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ private void notifyListeners(WebhookEvent event) {
event.getNAObjectList().forEach(id -> {
Capability module = dataListeners.get(id);
if (module != null) {
logger.trace("Dispatching webhook event to {}", id);
module.setNewData(event);
}
});
Expand Down

0 comments on commit 9f5740b

Please sign in to comment.