Google Maps supports battery level and charging. (#16969)

* Google Maps supports battery level and charging.

With 3.0.2 locationsharinglib now the battery level and the charging attributes are available.

* Update google_maps.py

fix too long line error

* Update google_maps.py

Fix multi line import, and line length limit

* Update gen_requirements_all.py

Add locationsharinglib to gen_requirements_all

* update requirements_all

* Last try to fix requirements_all...
This commit is contained in:
Totoo 2018-09-30 15:17:39 +02:00 committed by Fabian Affolter
parent f5632a5da5
commit 1b7bfec247
4 changed files with 11 additions and 3 deletions

View File

@ -11,13 +11,15 @@ import voluptuous as vol
from homeassistant.components.device_tracker import (
PLATFORM_SCHEMA, SOURCE_TYPE_GPS)
from homeassistant.const import ATTR_ID, CONF_PASSWORD, CONF_USERNAME
from homeassistant.const import (
ATTR_ID, CONF_PASSWORD, CONF_USERNAME, ATTR_BATTERY_CHARGING,
ATTR_BATTERY_LEVEL)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import track_time_interval
from homeassistant.helpers.typing import ConfigType
from homeassistant.util import slugify, dt as dt_util
REQUIREMENTS = ['locationsharinglib==2.0.11']
REQUIREMENTS = ['locationsharinglib==3.0.2']
_LOGGER = logging.getLogger(__name__)
@ -94,6 +96,8 @@ class GoogleMapsScanner:
ATTR_ID: person.id,
ATTR_LAST_SEEN: dt_util.as_utc(person.datetime),
ATTR_NICKNAME: person.nickname,
ATTR_BATTERY_CHARGING: person.charging,
ATTR_BATTERY_LEVEL: person.battery_level
}
self.see(
dev_id=dev_id,

View File

@ -558,7 +558,7 @@ liveboxplaytv==2.0.2
lmnotify==0.0.4
# homeassistant.components.device_tracker.google_maps
locationsharinglib==2.0.11
locationsharinglib==3.0.2
# homeassistant.components.logi_circle
logi_circle==0.1.7

View File

@ -103,6 +103,9 @@ libpurecoollink==0.4.2
# homeassistant.components.media_player.soundtouch
libsoundtouch==0.7.2
# homeassistant.components.device_tracker.google_maps
locationsharinglib==3.0.2
# homeassistant.components.sensor.mfi
# homeassistant.components.switch.mfi
mficlient==0.3.0

View File

@ -63,6 +63,7 @@ TEST_REQUIREMENTS = (
'influxdb',
'libpurecoollink',
'libsoundtouch',
'locationsharinglib',
'mficlient',
'numpy',
'paho-mqtt',