Skip to content

Commit

Permalink
fix: adjust HASS state classes for rain entities (#1018)
Browse files Browse the repository at this point in the history
  • Loading branch information
bachya authored Jun 21, 2024
1 parent 58b0d24 commit e11dbb4
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 50 deletions.
26 changes: 13 additions & 13 deletions ecowitt2mqtt/helpers/publisher/mqtt/hass.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,19 +428,19 @@ class HassDiscoveryInfo:
}

STATE_CLASS_OVERRIDES = {
DATA_POINT_DAILY_RAIN: StateClass.TOTAL_INCREASING,
DATA_POINT_DRAIN_PIEZO: StateClass.TOTAL_INCREASING,
DATA_POINT_ERAIN_PIEZO: StateClass.TOTAL_INCREASING,
DATA_POINT_EVENT_RAIN: StateClass.TOTAL_INCREASING,
DATA_POINT_HOURLY_RAIN: StateClass.MEASUREMENT,
DATA_POINT_HRAIN_PIEZO: StateClass.MEASUREMENT,
DATA_POINT_MONTHLY_RAIN: StateClass.TOTAL_INCREASING,
DATA_POINT_MRAIN_PIEZO: StateClass.TOTAL_INCREASING,
DATA_POINT_TOTAL_RAIN: StateClass.TOTAL_INCREASING,
DATA_POINT_WEEKLY_RAIN: StateClass.TOTAL_INCREASING,
DATA_POINT_WRAIN_PIEZO: StateClass.TOTAL_INCREASING,
DATA_POINT_YEARLY_RAIN: StateClass.TOTAL_INCREASING,
DATA_POINT_YRAIN_PIEZO: StateClass.TOTAL_INCREASING,
DATA_POINT_DAILY_RAIN: StateClass.TOTAL,
DATA_POINT_DRAIN_PIEZO: StateClass.TOTAL,
DATA_POINT_ERAIN_PIEZO: StateClass.TOTAL,
DATA_POINT_EVENT_RAIN: StateClass.TOTAL,
DATA_POINT_HOURLY_RAIN: StateClass.TOTAL,
DATA_POINT_HRAIN_PIEZO: StateClass.TOTAL,
DATA_POINT_MONTHLY_RAIN: StateClass.TOTAL,
DATA_POINT_MRAIN_PIEZO: StateClass.TOTAL,
DATA_POINT_TOTAL_RAIN: StateClass.TOTAL,
DATA_POINT_WEEKLY_RAIN: StateClass.TOTAL,
DATA_POINT_WRAIN_PIEZO: StateClass.TOTAL,
DATA_POINT_YEARLY_RAIN: StateClass.TOTAL,
DATA_POINT_YRAIN_PIEZO: StateClass.TOTAL,
}


Expand Down
2 changes: 1 addition & 1 deletion ecowitt2mqtt/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ async def create_loop() -> None:
)
await asyncio.sleep(delay)
except Exception as err: # pylint: disable=broad-except
LOGGER.exception("Exception caused a shutdown: %s", err)
LOGGER.exception("%s exception caused a shutdown: %s", type(err), err)
LOGGER.debug("".join(traceback.format_tb(err.__traceback__)))
self.stop()

Expand Down
Loading

0 comments on commit e11dbb4

Please sign in to comment.