Skip to content

Commit

Permalink
added attribution
Browse files Browse the repository at this point in the history
  • Loading branch information
rsnodgrass committed Jan 20, 2021
1 parent c3c4b4e commit 3d3201e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion custom_components/sensorpush/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from homeassistant.const import CONF_NAME, CONF_USERNAME, CONF_PASSWORD, CONF_SCAN_INTERVAL

from .const import (ATTR_BATTERY_VOLTAGE, ATTR_DEVICE_ID, ATTR_OBSERVED_TIME, ATTR_AGE,
ATTR_ATTRIBUTION, ATTRIBUTION,
ATTR_ALERT_MIN, ATTR_ALERT_MAX, CONF_UNIT_SYSTEM, CONF_MAXIMUM_AGE,
SENSORPUSH_DOMAIN, UNIT_SYSTEM_IMPERIAL, UNIT_SYSTEM_METRIC, UNIT_SYSTEMS)

Expand Down Expand Up @@ -163,7 +164,8 @@ def _update_callback(self):
self._attrs.update({
# ATTR_AGE : age_in_minutes,
ATTR_OBSERVED_TIME : observed_time,
ATTR_BATTERY_VOLTAGE : self._sensor_info.get(ATTR_BATTERY_VOLTAGE)
ATTR_BATTERY_VOLTAGE : self._sensor_info.get(ATTR_BATTERY_VOLTAGE),
ATTR_ATTRIBUTION : ATTRIBUTION,
})

alerts = self._sensor_info.get("alerts").get(self._field_name)
Expand Down
3 changes: 3 additions & 0 deletions custom_components/sensorpush/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

SENSORPUSH_DOMAIN = 'sensorpush'

ATTRIBUTION="Data provided by SensorPush"
ATTR_ATTRIBUTION="attribution"

ATTR_AGE = 'age'
ATTR_BATTERY_VOLTAGE = 'battery_voltage'
ATTR_DEVICE_ID = 'device_id'
Expand Down

0 comments on commit 3d3201e

Please sign in to comment.