Add google home alarm sensor (#20709)

* added googlehome alarm sensor

* splitted update method

* fix linting

* remove whitespace

* removed whitespace in line

* changed accordingly to the review

* removed redundant method

* Update homeassistant/components/googlehome/__init__.py

Co-Authored-By: eliseomartelli <martely98@gmail.com>
This commit is contained in:
Eliseo Martelli authored and Rohan Kapoor committed 2019-02-04 07:44:23 -08:00
1 parent 0cf71d5bcb
commit a40c5bf70e
3 files changed
+140 -5

No files matched your search

@@ -45,7 +45,7 @@ class GoogleHomeDeviceScanner(DeviceScanner):
async def async_init(self):
"""Further initialize connection to Google Home."""
await self.client.update_data(self.host)
await self.client.update_info(self.host)
data = self.hass.data[GOOGLEHOME_DOMAIN][self.host]
info = data.get('info', {})
connected = bool(info)
@@ -59,7 +59,7 @@ class GoogleHomeDeviceScanner(DeviceScanner):
async def async_update(self, now=None):
"""Ensure the information from Google Home is up to date."""
_LOGGER.debug('Checking Devices on %s', self.host)
await self.client.update_data(self.host)
await self.client.update_bluetooth(self.host)
data = self.hass.data[GOOGLEHOME_DOMAIN][self.host]
info = data.get('info')
bluetooth = data.get('bluetooth')