mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 01:37:08 +00:00
* Updgrae blinkpy to 0.10.0 - Remove status sensor (API endpoint unreliable for this) - Wifi strength reports in wifi bars rather than dBm (result of new API endpoint) - Added unique ids based on serial number * Update requirements
This commit is contained in:
parent
dc55718bc3
commit
f74e976be1
@ -43,6 +43,11 @@ class BlinkSyncModule(AlarmControlPanel):
|
|||||||
self._name = name
|
self._name = name
|
||||||
self._state = None
|
self._state = None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def unique_id(self):
|
||||||
|
"""Return the unique id for the sync module."""
|
||||||
|
return self.sync.serial
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def icon(self):
|
def icon(self):
|
||||||
"""Return icon."""
|
"""Return icon."""
|
||||||
@ -61,9 +66,10 @@ class BlinkSyncModule(AlarmControlPanel):
|
|||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
return {
|
attr = self.sync.attributes
|
||||||
ATTR_ATTRIBUTION: DEFAULT_ATTRIBUTION,
|
attr['network_info'] = self.data.networks
|
||||||
}
|
attr[ATTR_ATTRIBUTION] = DEFAULT_ATTRIBUTION
|
||||||
|
return attr
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Update the state of the device."""
|
"""Update the state of the device."""
|
||||||
|
@ -36,6 +36,7 @@ class BlinkBinarySensor(BinarySensorDevice):
|
|||||||
self._icon = icon
|
self._icon = icon
|
||||||
self._camera = data.sync.cameras[camera]
|
self._camera = data.sync.cameras[camera]
|
||||||
self._state = None
|
self._state = None
|
||||||
|
self._unique_id = "{}-{}".format(self._camera.serial, self._type)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
|
@ -15,7 +15,7 @@ from homeassistant.const import (
|
|||||||
CONF_BINARY_SENSORS, CONF_SENSORS, CONF_FILENAME,
|
CONF_BINARY_SENSORS, CONF_SENSORS, CONF_FILENAME,
|
||||||
CONF_MONITORED_CONDITIONS, TEMP_FAHRENHEIT)
|
CONF_MONITORED_CONDITIONS, TEMP_FAHRENHEIT)
|
||||||
|
|
||||||
REQUIREMENTS = ['blinkpy==0.9.0']
|
REQUIREMENTS = ['blinkpy==0.10.0']
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -36,7 +36,6 @@ TYPE_MOTION_DETECTED = 'motion_detected'
|
|||||||
TYPE_TEMPERATURE = 'temperature'
|
TYPE_TEMPERATURE = 'temperature'
|
||||||
TYPE_BATTERY = 'battery'
|
TYPE_BATTERY = 'battery'
|
||||||
TYPE_WIFI_STRENGTH = 'wifi_strength'
|
TYPE_WIFI_STRENGTH = 'wifi_strength'
|
||||||
TYPE_STATUS = 'status'
|
|
||||||
|
|
||||||
SERVICE_REFRESH = 'blink_update'
|
SERVICE_REFRESH = 'blink_update'
|
||||||
SERVICE_TRIGGER = 'trigger_camera'
|
SERVICE_TRIGGER = 'trigger_camera'
|
||||||
@ -50,8 +49,7 @@ BINARY_SENSORS = {
|
|||||||
SENSORS = {
|
SENSORS = {
|
||||||
TYPE_TEMPERATURE: ['Temperature', TEMP_FAHRENHEIT, 'mdi:thermometer'],
|
TYPE_TEMPERATURE: ['Temperature', TEMP_FAHRENHEIT, 'mdi:thermometer'],
|
||||||
TYPE_BATTERY: ['Battery', '%', 'mdi:battery-80'],
|
TYPE_BATTERY: ['Battery', '%', 'mdi:battery-80'],
|
||||||
TYPE_WIFI_STRENGTH: ['Wifi Signal', 'dBm', 'mdi:wifi-strength-2'],
|
TYPE_WIFI_STRENGTH: ['Wifi Signal', 'bars', 'mdi:wifi-strength-2'],
|
||||||
TYPE_STATUS: ['Status', '', 'mdi:bell']
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BINARY_SENSOR_SCHEMA = vol.Schema({
|
BINARY_SENSOR_SCHEMA = vol.Schema({
|
||||||
|
@ -38,6 +38,7 @@ class BlinkCamera(Camera):
|
|||||||
self.data = data
|
self.data = data
|
||||||
self._name = "{} {}".format(BLINK_DATA, name)
|
self._name = "{} {}".format(BLINK_DATA, name)
|
||||||
self._camera = camera
|
self._camera = camera
|
||||||
|
self._unique_id = "{}-camera".format(camera.serial)
|
||||||
self.response = None
|
self.response = None
|
||||||
self.current_image = None
|
self.current_image = None
|
||||||
self.last_image = None
|
self.last_image = None
|
||||||
@ -48,6 +49,11 @@ class BlinkCamera(Camera):
|
|||||||
"""Return the camera name."""
|
"""Return the camera name."""
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def unique_id(self):
|
||||||
|
"""Return the unique camera id."""
|
||||||
|
return self._unique_id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
"""Return the camera attributes."""
|
"""Return the camera attributes."""
|
||||||
@ -64,7 +70,7 @@ class BlinkCamera(Camera):
|
|||||||
@property
|
@property
|
||||||
def motion_detection_enabled(self):
|
def motion_detection_enabled(self):
|
||||||
"""Return the state of the camera."""
|
"""Return the state of the camera."""
|
||||||
return self._camera.armed
|
return self._camera.motion_enabled
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def brand(self):
|
def brand(self):
|
||||||
|
@ -43,12 +43,18 @@ class BlinkSensor(Entity):
|
|||||||
self._state = None
|
self._state = None
|
||||||
self._unit_of_measurement = units
|
self._unit_of_measurement = units
|
||||||
self._icon = icon
|
self._icon = icon
|
||||||
|
self._unique_id = "{}-{}".format(self._camera.serial, self._type)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
"""Return the name of the camera."""
|
"""Return the name of the camera."""
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def unique_id(self):
|
||||||
|
"""Return the unique id for the camera sensor."""
|
||||||
|
return self._unique_id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def icon(self):
|
def icon(self):
|
||||||
"""Return the icon of the sensor."""
|
"""Return the icon of the sensor."""
|
||||||
|
@ -179,7 +179,7 @@ bellows==0.7.0
|
|||||||
bimmer_connected==0.5.3
|
bimmer_connected==0.5.3
|
||||||
|
|
||||||
# homeassistant.components.blink
|
# homeassistant.components.blink
|
||||||
blinkpy==0.9.0
|
blinkpy==0.10.0
|
||||||
|
|
||||||
# homeassistant.components.light.blinksticklight
|
# homeassistant.components.light.blinksticklight
|
||||||
blinkstick==1.1.8
|
blinkstick==1.1.8
|
||||||
|
Loading…
x
Reference in New Issue
Block a user