Skip to content

Commit 71813a8

Browse files
committed
Fix several errors.
1 parent 054bfa8 commit 71813a8

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

gateway_addon/action.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,9 @@ def as_dict(self):
4949
5050
Returns a dictionary describing the action.
5151
"""
52-
return {
53-
'id': self.id,
54-
'name': self.name,
55-
'input': self.input,
56-
'status': self.status,
57-
'timeRequested': self.time_requested,
58-
'timeCompleted': self.time_completed,
59-
}
52+
d = self.as_action_description()
53+
d['id'] = self.id
54+
return d
6055

6156
def start(self):
6257
"""Start performing the action."""

gateway_addon/device.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,13 @@ def as_thing(self):
7575
'@context': self._context,
7676
'@type': self._type,
7777
'properties': self.get_property_descriptions(),
78+
'actions': self.actions,
79+
'events': self.events,
7880
'links': self.links,
7981
'baseHref': self.base_href,
8082
'pin': {
8183
'required': self.pin_required,
82-
'pattern': self.pin_regex,
84+
'pattern': self.pin_pattern,
8385
},
8486
'credentialsRequired': self.credentials_required,
8587
}

gateway_addon/event.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,4 @@ def as_dict(self):
4141
4242
Returns a dictionary describing the event.
4343
"""
44-
return {
45-
'name': self.name,
46-
'data': self.data,
47-
'timestamp': self.timestamp,
48-
}
44+
return self.as_event_description()

0 commit comments

Comments
 (0)