From 536ec26e31a064e814041238fc31873c2aec42f0 Mon Sep 17 00:00:00 2001 From: Ryan Snodgrass Date: Tue, 12 Nov 2019 23:29:33 -0800 Subject: [PATCH] revert to 0.0.1 --- custom_components/sensorpush/__init__.py | 5 +---- custom_components/sensorpush/sensor.py | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/custom_components/sensorpush/__init__.py b/custom_components/sensorpush/__init__.py index d81233c..474c602 100644 --- a/custom_components/sensorpush/__init__.py +++ b/custom_components/sensorpush/__init__.py @@ -129,9 +129,6 @@ def __init__(self, hass, config, sensor_info, unit_system, field_name): if not self._name: self._name = f"SensorPush {sensor_info.get('name')}" - # force state to be updated on creation - self._update_callback() - @property def name(self): """Return the display name for this sensor""" @@ -175,4 +172,4 @@ def _update_callback(self): LOG.info(f"Updated {self._name} to {self._state} {self.unit_of_measurement} : {latest_result}") # let Home Assistant know that SensorPush data for this entity has been updated - self.async_schedule_update_ha_state() \ No newline at end of file + self.async_schedule_update_ha_state() diff --git a/custom_components/sensorpush/sensor.py b/custom_components/sensorpush/sensor.py index aa68006..49542d1 100644 --- a/custom_components/sensorpush/sensor.py +++ b/custom_components/sensorpush/sensor.py @@ -64,6 +64,7 @@ class SensorPushHumidity(SensorPushEntity): def __init__(self, hass, config, sensor_info, unit_system): self._name = f"{sensor_info.get('name')} Humidity" + self._state = 0.0 super().__init__(hass, config, sensor_info, unit_system, 'humidity') @property @@ -81,6 +82,7 @@ class SensorPushTemperature(SensorPushEntity): def __init__(self, hass, config, sensor_info, unit_system): self._name = f"{sensor_info.get('name')} Temperature" + self._state = 0.0 super().__init__(hass, config, sensor_info, unit_system, 'temperature') @property