Skip to content

Commit

Permalink
Add battery to GenericPushTarget message for iSpindels (Closes #600)
Browse files Browse the repository at this point in the history
  • Loading branch information
thorrak committed Apr 5, 2021
1 parent 518a358 commit acdf65c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/develop/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Changed
- Added Beer Setting, Fridge Setting, and Controller State to generic external push targets
- Upgraded TiltBridge support for v1.0.0 TiltBridges (earlier TiltBridge versions will now require manual configuration)
- External push target attempts now log to huey stdout
- Added battery to the GenericPushTarget message for pushed iSpindel devices


Fixed
Expand Down
5 changes: 5 additions & 0 deletions external_push/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ def data_to_push(self):
grav_dict['temp'] = float(latest_log_point.temp)
grav_dict['temp_format'] = latest_log_point.temp_format

if sensor.sensor_type == GravitySensor.SENSOR_ISPINDEL:
extras = sensor.ispindel_configuration.load_extras_from_redis()
if 'battery' in extras: # Load & send the iSpindel battery
to_send['battery'] = extras['battery']

to_send['gravity_sensors'].append(grav_dict)

string_to_send = json.dumps(to_send)
Expand Down

0 comments on commit acdf65c

Please sign in to comment.