Skip to content

Commit

Permalink
Setting a special polling interval for challenge sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
valleedelisle committed Jan 4, 2022
1 parent 0e09a68 commit 5c5d52c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions custom_components/hilo/const.py
Expand Up @@ -26,6 +26,8 @@
DEFAULT_SCAN_INTERVAL = 60
MIN_SCAN_INTERVAL = 15

CHALLENGE_SENSOR_INTERVAL = 300

CONF_TARIFF = {
"rate d": {
"low_threshold": 40,
Expand Down
3 changes: 2 additions & 1 deletion custom_components/hilo/sensor.py
Expand Up @@ -42,6 +42,7 @@

from . import Hilo, HiloEntity
from .const import (
CHALLENGE_SENSOR_INTERVAL,
CONF_ENERGY_METER_PERIOD,
CONF_GENERATE_ENERGY_METERS,
CONF_HQ_PLAN_NAME,
Expand Down Expand Up @@ -92,7 +93,7 @@ def generate_entities_from_device(device, hilo, scan_interval):
entities = []
if device.type == "Gateway":
entities.append(
HiloChallengeSensor(hilo, device, scan_interval),
HiloChallengeSensor(hilo, device, CHALLENGE_SENSOR_INTERVAL),
)
entities.append(
HiloRewardSensor(hilo, device, scan_interval),
Expand Down

0 comments on commit 5c5d52c

Please sign in to comment.