Skip to content

Commit

Permalink
Merge pull request #31712 from home-assistant/rc
Browse files Browse the repository at this point in the history
0.105.3
  • Loading branch information
balloob committed Feb 10, 2020
2 parents 76d2658 + 992484f commit fb6fb42
Show file tree
Hide file tree
Showing 16 changed files with 88 additions and 69 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/adguard/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "AdGuard Home",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/adguard",
"requirements": ["adguardhome==0.4.0"],
"requirements": ["adguardhome==0.4.1"],
"dependencies": [],
"codeowners": ["@frenck"]
}
69 changes: 35 additions & 34 deletions homeassistant/components/august/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,15 @@
DATA_AUGUST = "august"
DOMAIN = "august"
DEFAULT_ENTITY_NAMESPACE = "august"
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=5)
DEFAULT_SCAN_INTERVAL = timedelta(seconds=5)

# Limit battery and hardware updates to 1800 seconds
# in order to reduce the number of api requests and
# avoid hitting rate limits
MIN_TIME_BETWEEN_LOCK_DETAIL_UPDATES = timedelta(seconds=1800)

DEFAULT_SCAN_INTERVAL = timedelta(seconds=10)
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=10)

LOGIN_METHODS = ["phone", "email"]

CONFIG_SCHEMA = vol.Schema(
Expand Down Expand Up @@ -180,7 +187,9 @@ def __init__(self, hass, api, access_token):
self._access_token = access_token
self._doorbells = self._api.get_doorbells(self._access_token) or []
self._locks = self._api.get_operable_locks(self._access_token) or []
self._house_ids = [d.house_id for d in self._doorbells + self._locks]
self._house_ids = set()
for device in self._doorbells + self._locks:
self._house_ids.add(device.house_id)

self._doorbell_detail_by_id = {}
self._lock_status_by_id = {}
Expand Down Expand Up @@ -284,58 +293,51 @@ def get_door_state(self, lock_id):
This is the status from the door sensor.
"""
self._update_doors()
self._update_locks_status()
return self._door_state_by_id.get(lock_id)

def _update_locks(self):
self._update_locks_status()
self._update_locks_detail()

@Throttle(MIN_TIME_BETWEEN_UPDATES)
def _update_doors(self):
def _update_locks_status(self):
status_by_id = {}
state_by_id = {}

_LOGGER.debug("Start retrieving door status")
_LOGGER.debug("Start retrieving lock and door status")
for lock in self._locks:
_LOGGER.debug("Updating door status for %s", lock.device_name)

_LOGGER.debug("Updating lock and door status for %s", lock.device_name)
try:
state_by_id[lock.device_id] = self._api.get_lock_door_status(
self._access_token, lock.device_id
(
status_by_id[lock.device_id],
state_by_id[lock.device_id],
) = self._api.get_lock_status(
self._access_token, lock.device_id, door_status=True
)
except RequestException as ex:
_LOGGER.error(
"Request error trying to retrieve door status for %s. %s",
"Request error trying to retrieve lock and door status for %s. %s",
lock.device_name,
ex,
)
status_by_id[lock.device_id] = None
state_by_id[lock.device_id] = None
except Exception:
status_by_id[lock.device_id] = None
state_by_id[lock.device_id] = None
raise

_LOGGER.debug("Completed retrieving door status")
_LOGGER.debug("Completed retrieving lock and door status")
self._lock_status_by_id = status_by_id
self._door_state_by_id = state_by_id

@Throttle(MIN_TIME_BETWEEN_UPDATES)
def _update_locks(self):
status_by_id = {}
@Throttle(MIN_TIME_BETWEEN_LOCK_DETAIL_UPDATES)
def _update_locks_detail(self):
detail_by_id = {}

_LOGGER.debug("Start retrieving locks status")
_LOGGER.debug("Start retrieving locks detail")
for lock in self._locks:
_LOGGER.debug("Updating lock status for %s", lock.device_name)
try:
status_by_id[lock.device_id] = self._api.get_lock_status(
self._access_token, lock.device_id
)
except RequestException as ex:
_LOGGER.error(
"Request error trying to retrieve door status for %s. %s",
lock.device_name,
ex,
)
status_by_id[lock.device_id] = None
except Exception:
status_by_id[lock.device_id] = None
raise

try:
detail_by_id[lock.device_id] = self._api.get_lock_detail(
self._access_token, lock.device_id
Expand All @@ -351,8 +353,7 @@ def _update_locks(self):
detail_by_id[lock.device_id] = None
raise

_LOGGER.debug("Completed retrieving locks status")
self._lock_status_by_id = status_by_id
_LOGGER.debug("Completed retrieving locks detail")
self._lock_detail_by_id = detail_by_id

def lock(self, device_id):
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/august/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

_LOGGER = logging.getLogger(__name__)

SCAN_INTERVAL = timedelta(seconds=5)
SCAN_INTERVAL = timedelta(seconds=10)


def _retrieve_door_state(data, lock):
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/august/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from . import DATA_AUGUST, DEFAULT_TIMEOUT

SCAN_INTERVAL = timedelta(seconds=5)
SCAN_INTERVAL = timedelta(seconds=10)


def setup_platform(hass, config, add_entities, discovery_info=None):
Expand Down
9 changes: 7 additions & 2 deletions homeassistant/components/august/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

_LOGGER = logging.getLogger(__name__)

SCAN_INTERVAL = timedelta(seconds=5)
SCAN_INTERVAL = timedelta(seconds=10)


def setup_platform(hass, config, add_entities, discovery_info=None):
Expand Down Expand Up @@ -88,7 +88,12 @@ def device_state_attributes(self):
if self._lock_detail is None:
return None

return {ATTR_BATTERY_LEVEL: self._lock_detail.battery_level}
attributes = {ATTR_BATTERY_LEVEL: self._lock_detail.battery_level}

if self._lock_detail.keypad is not None:
attributes["keypad_battery_level"] = self._lock_detail.keypad.battery_level

return attributes

@property
def unique_id(self) -> str:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/august/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"domain": "august",
"name": "August",
"documentation": "https://www.home-assistant.io/integrations/august",
"requirements": ["py-august==0.7.0"],
"requirements": ["py-august==0.8.1"],
"dependencies": ["configurator"],
"codeowners": []
}
6 changes: 3 additions & 3 deletions homeassistant/components/garmin_connect/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,21 +256,21 @@
"brpm",
"mdi:progress-clock",
None,
True,
False,
],
"lowestRespirationValue": [
"Lowest Respiration",
"brpm",
"mdi:progress-clock",
None,
True,
False,
],
"latestRespirationValue": [
"Latest Respiration",
"brpm",
"mdi:progress-clock",
None,
True,
False,
],
"latestRespirationTimeGMT": [
"Latest Respiration Update",
Expand Down
16 changes: 10 additions & 6 deletions homeassistant/components/garmin_connect/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,16 @@ async def async_update(self):
return

data = self._data.data
if "Duration" in self._type and data[self._type]:
self._state = data[self._type] // 60
elif "Seconds" in self._type and data[self._type]:
self._state = data[self._type] // 60
else:
self._state = data[self._type]
try:
if "Duration" in self._type and data[self._type]:
self._state = data[self._type] // 60
elif "Seconds" in self._type and data[self._type]:
self._state = data[self._type] // 60
else:
self._state = data[self._type]
except KeyError:
_LOGGER.debug("Entity type %s not found in fetched data", self._type)
return

_LOGGER.debug(
"Entity %s set to state %s %s", self._type, self._state, self._unit
Expand Down
10 changes: 5 additions & 5 deletions homeassistant/components/mikrotik/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def force_dhcp(self):
def get_info(self, param):
"""Return device model name."""
cmd = IDENTITY if param == NAME else INFO
data = list(self.command(MIKROTIK_SERVICES[cmd]))
data = self.command(MIKROTIK_SERVICES[cmd])
return data[0].get(param) if data else None

def get_hub_details(self):
Expand All @@ -148,7 +148,7 @@ def connect_to_hub(self):

def get_list_from_interface(self, interface):
"""Get devices from interface."""
result = list(self.command(MIKROTIK_SERVICES[interface]))
result = self.command(MIKROTIK_SERVICES[interface])
return self.load_mac(result) if result else {}

def restore_device(self, mac):
Expand Down Expand Up @@ -224,7 +224,7 @@ def do_arp_ping(self, ip_address, interface):
"address": ip_address,
}
cmd = "/ping"
data = list(self.command(cmd, params))
data = self.command(cmd, params)
if data is not None:
status = 0
for result in data:
Expand All @@ -242,9 +242,9 @@ def command(self, cmd, params=None):
try:
_LOGGER.info("Running command %s", cmd)
if params:
response = self.api(cmd=cmd, **params)
response = list(self.api(cmd=cmd, **params))
else:
response = self.api(cmd=cmd)
response = list(self.api(cmd=cmd))
except (
librouteros.exceptions.ConnectionClosed,
socket.error,
Expand Down
11 changes: 10 additions & 1 deletion homeassistant/components/mill/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
from homeassistant.components.climate.const import (
CURRENT_HVAC_HEAT,
CURRENT_HVAC_IDLE,
FAN_ON,
HVAC_MODE_HEAT,
HVAC_MODE_OFF,
Expand Down Expand Up @@ -167,13 +169,20 @@ def max_temp(self):
"""Return the maximum temperature."""
return MAX_TEMP

@property
def hvac_action(self):
"""Return current hvac i.e. heat, cool, idle."""
if self._heater.is_gen1 or self._heater.is_heating == 1:
return CURRENT_HVAC_HEAT
return CURRENT_HVAC_IDLE

@property
def hvac_mode(self) -> str:
"""Return hvac operation ie. heat, cool mode.
Need to be one of HVAC_MODE_*.
"""
if self._heater.is_gen1 or self._heater.is_heating == 1:
if self._heater.is_gen1 or self._heater.power_status == 1:
return HVAC_MODE_HEAT
return HVAC_MODE_OFF

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/netatmo/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def update(self):

if data is None:
_LOGGER.info("No data found for %s (%s)", self.module_name, self._module_id)
_LOGGER.error("data: %s", self.netatmo_data.data)
_LOGGER.debug("data: %s", self.netatmo_data.data)
self._state = None
return

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/nws/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"documentation": "https://www.home-assistant.io/integrations/nws",
"dependencies": [],
"codeowners": ["@MatthewFlamm"],
"requirements": ["pynws==0.10.1"]
"requirements": ["pynws==0.10.4"]
}
4 changes: 2 additions & 2 deletions homeassistant/components/zha/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/zha",
"requirements": [
"bellows-homeassistant==0.13.1",
"bellows-homeassistant==0.13.2",
"zha-quirks==0.0.32",
"zigpy-deconz==0.7.0",
"zigpy-homeassistant==0.13.0",
"zigpy-homeassistant==0.13.2",
"zigpy-xbee-homeassistant==0.9.0",
"zigpy-zigate==0.5.1"
],
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/const.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Constants used by Home Assistant components."""
MAJOR_VERSION = 0
MINOR_VERSION = 105
PATCH_VERSION = "2"
PATCH_VERSION = "3"
__short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}"
__version__ = f"{__short_version__}.{PATCH_VERSION}"
REQUIRED_PYTHON_VER = (3, 7, 0)
Expand Down
10 changes: 5 additions & 5 deletions requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ adafruit-circuitpython-mcp230xx==1.1.2
adb-shell==0.1.1

# homeassistant.components.adguard
adguardhome==0.4.0
adguardhome==0.4.1

# homeassistant.components.frontier_silicon
afsapi==0.0.4
Expand Down Expand Up @@ -299,7 +299,7 @@ beautifulsoup4==4.8.2
beewi_smartclim==0.0.7

# homeassistant.components.zha
bellows-homeassistant==0.13.1
bellows-homeassistant==0.13.2

# homeassistant.components.bmw_connected_drive
bimmer_connected==0.6.2
Expand Down Expand Up @@ -1067,7 +1067,7 @@ pushetta==1.0.15
pwmled==1.4.1

# homeassistant.components.august
py-august==0.7.0
py-august==0.8.1

# homeassistant.components.canary
py-canary==0.5.0
Expand Down Expand Up @@ -1399,7 +1399,7 @@ pynuki==1.3.3
pynut2==2.1.2

# homeassistant.components.nws
pynws==0.10.1
pynws==0.10.4

# homeassistant.components.nx584
pynx584==0.4
Expand Down Expand Up @@ -2130,7 +2130,7 @@ ziggo-mediabox-xl==1.1.0
zigpy-deconz==0.7.0

# homeassistant.components.zha
zigpy-homeassistant==0.13.0
zigpy-homeassistant==0.13.2

# homeassistant.components.zha
zigpy-xbee-homeassistant==0.9.0
Expand Down
Loading

0 comments on commit fb6fb42

Please sign in to comment.