Skip to content
This repository has been archived by the owner on Jul 23, 2021. It is now read-only.

Commit

Permalink
Updated to use get_sensor()
Browse files Browse the repository at this point in the history
OK just using phue bridge object but parsing with hue_sensors and its
nice and fast :-)
  • Loading branch information
robmarkcole committed Dec 23, 2017
1 parent 0f6ea08 commit ba6d923
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions custom_components/sensor/hue.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,18 @@
DEPENDENCIES = ['hue']

_LOGGER = logging.getLogger(__name__)
SCAN_INTERVAL = timedelta(seconds=1)
REQUIREMENTS = ['hue-sensors-phue==1.0']
SCAN_INTERVAL = timedelta(seconds=0.1)
REQUIREMENTS = ['hue-sensors==1.2']


def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up the Hue sensors."""
import hue_sensors_phue as hs
import hue_sensors as hs
if discovery_info is None or 'bridge_id' not in discovery_info:
return

## Whats going on here?
bridge_id = discovery_info['bridge_id']
bridge = hass.data[hue.DOMAIN][bridge_id]
_LOGGER.warning('Bridge was found XXXXXXXXXXX')

data = HueSensorData(bridge, hs.parse_hue_api_response)
data.update()
Expand All @@ -51,7 +49,7 @@ def __init__(self, bridge, parse_hue_api_response):
@Throttle(SCAN_INTERVAL)
def update(self):
"""Get the latest data."""
response = self.bridge.bridge.get_sensor_objects('name')
response = self.bridge.bridge.get_sensor()
self.data = self.parse_hue_api_response(response)


Expand Down

0 comments on commit ba6d923

Please sign in to comment.