Skip to content

Commit ffbefe4

Browse files
committed
updated samples() call that changed in pysensorpush
1 parent 01caf0d commit ffbefe4

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
Home Assistant integration for wireless SensorPush temperature and humidity/hygrometer sensors.
1111

12-
[![coffee](https://www.buymeacoffee.com/assets/img/custom_images/black_img.png)](https://buymeacoffee.com/DYks67r)
13-
1412
## Hardware Supported
1513

1614
| Model | Temp | Humidity | Presure | Dewpoint | VPD | Waterproof | Battery Life | Range |

custom_components/sensorpush/__init__.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,9 @@ def setup(hass, config):
7171
# return False
7272
# FIXME: log warning if no sensors found?
7373

74-
hass.data[SENSORPUSH_SAMPLES] = sensorpush_service.samples
74+
hass.data[SENSORPUSH_SAMPLES] = sensorpush_service.samples()
7575

7676
# FIXME: trigger automatic setup of sensors
77-
7877

7978
except (ConnectTimeout, HTTPError) as ex:
8079
LOG.error("Unable to connect to SensorPush: %s", str(ex))
@@ -92,7 +91,7 @@ def refresh_sensorpush_data(event_time):
9291
#hass.data[SENSORPUSH_SERVICE].update(update_devices=True)
9392

9493
# retrieve the latest samples from the SensorPush cloud service
95-
latest_samples = hass.data[SENSORPUSH_SERVICE].samples
94+
latest_samples = hass.data[SENSORPUSH_SERVICE].samples()
9695
if latest_samples:
9796
hass.data[SENSORPUSH_SAMPLES] = latest_samples
9897

@@ -146,7 +145,7 @@ def extra_state_attributes(self):
146145
@callback
147146
def _update_callback(self):
148147
samples = self.hass.data[SENSORPUSH_SAMPLES]
149-
sensor_results = samples['sensors']
148+
sensor_results = samples.get('sensors')
150149

151150
sensor_data = sensor_results[self._device_id]
152151
latest_result = sensor_data[0]

custom_components/sensorpush/manifest.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"name": "SensorPush",
44
"documentation": "https://github.com/rsnodgrass/hass-sensorpush/",
55
"issue_tracker": "https://github.com/rsnodgrass/hass-sensorpush/issues",
6-
"requirements": ["pysensorpush>=0.1.6"],
7-
"version": "0.1.0",
6+
"requirements": ["pysensorpush>=0.1.7"],
7+
"version": "0.1.1",
88
"dependencies": [],
99
"codeowners": ["@rsnodgrass"],
1010
"iot_class": "cloud_polling"

0 commit comments

Comments
 (0)