Skip to content

Commit

Permalink
firmware: Log role
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnor committed Jan 12, 2020
1 parent 7e073bb commit 3baba29
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion firmware/dlockoslo.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ def __init__(self, role):
d = copy.deepcopy(participant_definition)
msgflo.Participant.__init__(self, d, role)

self.role = role
self.discovery_period = float(os.environ.get("DLOCK_DISCOVERY_PERIOD", "60"))
self.poll_interval = float(os.environ.get("DLOCK_POLL_INTERVAL", "0.2"))

Expand Down Expand Up @@ -379,7 +380,7 @@ def recalculate_state(self, mqtt_request=None):

state_changed = is_state_change(self.state, next)
if state_changed:
entry = { 'inputs': inputs, 'state': next.__dict__ }
entry = { 'role': self.role, 'inputs': inputs, 'state': next.__dict__ }
log.info(entry)

if connected:
Expand Down

0 comments on commit 3baba29

Please sign in to comment.