Skip to content

Commit c5702f2

Browse files
committed
add alert enabled attribute
1 parent b4eabc6 commit c5702f2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

custom_components/sensorpush/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
from homeassistant.const import CONF_NAME, CONF_USERNAME, CONF_PASSWORD, CONF_SCAN_INTERVAL
2222

2323
from .const import (ATTR_BATTERY_VOLTAGE, ATTR_DEVICE_ID, ATTR_OBSERVED_TIME, ATTR_AGE,
24-
ATTR_ATTRIBUTION, ATTRIBUTION, MEASURES,
25-
ATTR_ALERT_MIN, ATTR_ALERT_MAX, CONF_UNIT_SYSTEM, CONF_MAXIMUM_AGE,
24+
ATTR_ATTRIBUTION, ATTRIBUTION, MEASURES, CONF_UNIT_SYSTEM, CONF_MAXIMUM_AGE,
25+
ATTR_ALERT_MIN, ATTR_ALERT_MAX, ATTR_ALERT_ENABLED,
2626
SENSORPUSH_DOMAIN, UNIT_SYSTEM_IMPERIAL, UNIT_SYSTEM_METRIC, UNIT_SYSTEMS)
2727

2828
LOG = logging.getLogger(__name__)
@@ -172,7 +172,8 @@ def _update_callback(self):
172172
if alerts.get("min"):
173173
self._attrs.update({
174174
ATTR_ALERT_MIN: alerts.get("min"),
175-
ATTR_ALERT_MAX: alerts.get("max")
175+
ATTR_ALERT_MAX: alerts.get("max"),
176+
ATTR_ALERT_ENABLED: alerts.get("enabled")
176177
})
177178

178179
# LOG.info(f"{self._state} ... {self._attrs} ... {sensor_data} ... {self._sensor_info}")

custom_components/sensorpush/const.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
ATTR_OBSERVED_TIME = 'observed_time'
1212
ATTR_ALERT_MIN = 'alert_min'
1313
ATTR_ALERT_MAX = 'alert_max'
14+
ATTR_ALERT_ENABLED = 'alert_enabled'
1415

1516
CONF_UNIT_SYSTEM = 'unit_system'
1617
CONF_MAXIMUM_AGE = 'maximum_age' # maximum age (in minutes) of observations before they expire

0 commit comments

Comments
 (0)