Skip to content

Commit

Permalink
Increase scan interval, add rounded values for sensors
Browse files Browse the repository at this point in the history
  • Loading branch information
PiotrMachowski committed Jan 17, 2023
1 parent 0599ee2 commit 5c2d188
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions custom_components/gne_pv_monitoring/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Platforms
SENSOR = "sensor"
PLATFORMS = [SENSOR]
SCAN_INTERVAL = datetime.timedelta(minutes=10, seconds=1)
SCAN_INTERVAL = datetime.timedelta(minutes=5, seconds=1)

# Configuration and options
CONF_APP_ID = "app_id"
Expand All @@ -27,7 +27,7 @@
# API
URL = "http://newapi.gnetek.com/trdapp/queryBeehiveHoneybees"
DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S"
MIN_TIME_BETWEEN_CALLS = datetime.timedelta(minutes=10)
MIN_TIME_BETWEEN_CALLS = datetime.timedelta(minutes=5)
PARAMETERS = {
"inVoltage1": {
"unit": ELECTRIC_POTENTIAL_VOLT,
Expand Down
6 changes: 3 additions & 3 deletions custom_components/gne_pv_monitoring/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ def unique_id(self):

@property
def extra_state_attributes(self):
return {
"raw_value": self.state
}
if self.entity_category is None:
return {"rounded_value": round(self.state)}
return {}

0 comments on commit 5c2d188

Please sign in to comment.