Compare commits

...

22 Commits

Author SHA1 Message Date
Paulus Schoutsen
7818c98c67 Merge pull request #23932 from home-assistant/rc
0.93.1
2019-05-17 08:03:45 +02:00
Paulus Schoutsen
e12222697c Bumped version to 0.93.1 2019-05-17 06:35:20 +02:00
karlkar
58f28f177d Fix problem with cameras that don't support time (#23924)
Some onvif cameras don't support Date management. In that case None is returned and script crashes when trying to obtain date
2019-05-17 06:35:09 +02:00
Joakim Plate
6030e419c5 Switch media player to SWITCH type (#23914)
MEDIA device type is being rejected by google now.
2019-05-17 06:33:20 +02:00
Paulus Schoutsen
8d2a784831 Update Honeywell warning (#23913) 2019-05-17 06:33:20 +02:00
Pascal Vizeli
5dc841ecae Fix Hassio-version for Azure Pipelines (#23895) 2019-05-17 06:33:19 +02:00
Paulus Schoutsen
584bfbaa76 Merge pull request #23864 from home-assistant/rc
0.93.0
2019-05-16 07:08:27 +02:00
Paulus Schoutsen
0f140751b2 Fix PS4 blocking startup (#23893) 2019-05-16 05:43:45 +02:00
Pascal Vizeli
6aa9844f8f Fix auto discovery if the monitor condition (#23880) 2019-05-15 16:28:35 +02:00
Paulus Schoutsen
177594f02c Update sensor.py 2019-05-15 14:00:42 +02:00
Pascal Vizeli
3f841a36a5 Update azure-pipelines.yml for Azure Pipelines
Automated version updates
2019-05-14 22:59:12 +02:00
damarco
80ae02cc49 Fix zha timed off (#23849) 2019-05-14 13:41:27 +02:00
Paulus Schoutsen
421b2962c6 Bumped version to 0.93.0 2019-05-14 13:18:36 +02:00
Paulus Schoutsen
bde5a9ef01 Bumped version to 0.93.0b4 2019-05-14 13:12:30 +02:00
Robbie Trencheny
b79886ad85 Fix improper usage of body attribute on web.Response. Should be text since we arent sending bytes (#23857) 2019-05-14 13:12:24 +02:00
Paulus Schoutsen
f083abbed1 Bumped version to 0.93.0b3 2019-05-14 07:19:37 +02:00
David F. Mulcahey
4dd8423b9b bump zha-quirks (#23855) 2019-05-14 07:19:31 +02:00
David F. Mulcahey
8ba2ab567e Fix ZHA battery when readings produce an unknown value (#23854)
* check for unknown readings

* only publish valid readings

* remove unused constant
2019-05-14 07:19:30 +02:00
David F. Mulcahey
3d821b9148 Correct ZHA illumination conversion (#23853)
* fix illumination values

* correct formula

* update illuminance calculation

* update test
2019-05-14 07:19:30 +02:00
Jason Hunter
04720175b9 fix onvif wsdl import - take 2 (#23807) 2019-05-14 07:19:29 +02:00
Alexei Chetroi
93ad7b2e45 Do not add coordinator to the ZHA entities. (#23803) 2019-05-14 07:19:28 +02:00
Paulus Schoutsen
9b12dd66e4 Updated frontend to 20190514.0 2019-05-14 07:08:06 +02:00
23 changed files with 101 additions and 45 deletions

View File

@@ -16,6 +16,7 @@ variables:
value: '0.3'
- group: docker
- group: wheels
- group: github
jobs:
@@ -141,3 +142,45 @@ jobs:
-r https://github.com/home-assistant/hassio-homeassistant \
-t machine --docker-hub homeassistant
displayName: 'Build Release'
- job: 'ReleasePublish'
condition: and(startsWith(variables['Build.SourceBranch'], 'refs/tags'), succeeded('Release'))
dependsOn:
- 'Release'
pool:
vmImage: 'ubuntu-16.04'
steps:
- script: |
sudo apt-get install -y --no-install-recommends \
git jq
git config --global user.name "Pascal Vizeli"
git config --global user.email "pvizeli@syshack.ch"
git config --global credential.helper store
echo "https://$(githubToken):x-oauth-basic@github.com" > $HOME\.git-credentials
displayName: 'Install requirements'
- script: |
set -e
version="$(Build.SourceBranchName)"
git clone https://github.com/home-assistant/hassio-version
cd hassio-version
dev_version="$(jq --raw-output '.homeassistant.default' dev.json)"
beta_version="$(jq --raw-output '.homeassistant.default' beta.json)"
stable_version="$(jq --raw-output '.homeassistant.default' stable.json)"
if [[ "$version" =~ b ]]; then
sed -i "s|$dev_version|$version|g" dev.json
sed -i "s|$beta_version|$version|g" beta.json
else
sed -i "s|$dev_version|$version|g" dev.json
sed -i "s|$beta_version|$version|g" beta.json
sed -i "s|$stable_version|$version|g" stable.json
fi
git commit -am "Bump Home Assistant $version"
git push

View File

@@ -3,7 +3,7 @@
"name": "Home Assistant Frontend",
"documentation": "https://www.home-assistant.io/components/frontend",
"requirements": [
"home-assistant-frontend==20190510.0"
"home-assistant-frontend==20190514.0"
],
"dependencies": [
"api",

View File

@@ -72,7 +72,7 @@ async def handle_webhook(hass, webhook_id, request):
data = WEBHOOK_SCHEMA(dict(await request.post()))
except vol.MultipleInvalid as error:
return web.Response(
body=error.error_message,
text=error.error_message,
status=HTTP_UNPROCESSABLE_ENTITY
)

View File

@@ -53,7 +53,6 @@ TYPE_SENSOR = PREFIX_TYPES + 'SENSOR'
TYPE_DOOR = PREFIX_TYPES + 'DOOR'
TYPE_TV = PREFIX_TYPES + 'TV'
TYPE_SPEAKER = PREFIX_TYPES + 'SPEAKER'
TYPE_MEDIA = PREFIX_TYPES + 'MEDIA'
SERVICE_REQUEST_SYNC = 'request_sync'
HOMEGRAPH_URL = 'https://homegraph.googleapis.com/'
@@ -89,7 +88,7 @@ DOMAIN_TO_GOOGLE_TYPES = {
input_boolean.DOMAIN: TYPE_SWITCH,
light.DOMAIN: TYPE_LIGHT,
lock.DOMAIN: TYPE_LOCK,
media_player.DOMAIN: TYPE_MEDIA,
media_player.DOMAIN: TYPE_SWITCH,
scene.DOMAIN: TYPE_SCENE,
script.DOMAIN: TYPE_SCENE,
switch.DOMAIN: TYPE_SWITCH,

View File

@@ -55,8 +55,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
_LOGGER.warning(
"The honeywell component is deprecated for EU (i.e. non-US) systems, "
"this functionality will be removed in version 0.96.")
_LOGGER.warning(
"this functionality will be removed in version 0.96. "
"Please switch to the evohome component, "
"see: https://home-assistant.io/components/evohome")

View File

@@ -58,7 +58,7 @@ async def handle_webhook(hass, webhook_id, request):
data = WEBHOOK_SCHEMA(dict(await request.post()))
except vol.MultipleInvalid as error:
return web.Response(
body=error.error_message,
text=error.error_message,
status=HTTP_UNPROCESSABLE_ENTITY
)
@@ -76,7 +76,7 @@ async def handle_webhook(hass, webhook_id, request):
location_name
)
return web.Response(
body='Setting location to {}'.format(location_name),
text='Setting location to {}'.format(location_name),
status=HTTP_OK
)

View File

@@ -81,7 +81,7 @@ def registration_context(registration: Dict) -> Context:
def empty_okay_response(headers: Dict = None, status: int = 200) -> Response:
"""Return a Response with empty JSON object and a 200."""
return Response(body='{}', status=status, content_type='application/json',
return Response(text='{}', status=status, content_type='application/json',
headers=headers)

View File

@@ -145,7 +145,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
# Only create sensors for monitored properties
for condition in monitored_conditions:
dev.append(NetatmoSensor(
data, module_name, condition))
data, module_name, condition.lower()))
for module_name, _ in not_handled.items():
_LOGGER.error('Module name: "%s" not found', module_name)

View File

@@ -164,27 +164,28 @@ class ONVIFHassCamera(Camera):
system_date = dt_util.utcnow()
device_time = await devicemgmt.GetSystemDateAndTime()
cdate = device_time.UTCDateTime
cam_date = dt.datetime(cdate.Date.Year, cdate.Date.Month,
cdate.Date.Day, cdate.Time.Hour,
cdate.Time.Minute, cdate.Time.Second,
0, dt_util.UTC)
if device_time:
cdate = device_time.UTCDateTime
cam_date = dt.datetime(cdate.Date.Year, cdate.Date.Month,
cdate.Date.Day, cdate.Time.Hour,
cdate.Time.Minute, cdate.Time.Second,
0, dt_util.UTC)
_LOGGER.debug("Camera date/time: %s",
cam_date)
_LOGGER.debug("Camera date/time: %s",
cam_date)
_LOGGER.debug("System date/time: %s",
system_date)
_LOGGER.debug("System date/time: %s",
system_date)
dt_diff = cam_date - system_date
dt_diff_seconds = dt_diff.total_seconds()
dt_diff = cam_date - system_date
dt_diff_seconds = dt_diff.total_seconds()
if dt_diff_seconds > 5:
_LOGGER.warning("The date/time on the camera is '%s', "
"which is different from the system '%s', "
"this could lead to authentication issues",
cam_date,
system_date)
if dt_diff_seconds > 5:
_LOGGER.warning("The date/time on the camera is '%s', "
"which is different from the system '%s', "
"this could lead to authentication issues",
cam_date,
system_date)
_LOGGER.debug("Obtaining input uri")

View File

@@ -3,7 +3,7 @@
"name": "Onvif",
"documentation": "https://www.home-assistant.io/components/onvif",
"requirements": [
"onvif-zeep-async==0.1.3"
"onvif-zeep-async==0.2.0"
],
"dependencies": [
"ffmpeg"

View File

@@ -73,7 +73,6 @@ async def async_migrate_entry(hass, entry):
# Remove old entity entry.
registry.async_remove(entity_id)
await hass.async_block_till_done()
# Format old unique_id.
unique_id = format_unique_id(entry.data[CONF_TOKEN], unique_id)

View File

@@ -66,7 +66,7 @@ class ZestimateDataSensor(Entity):
self.data = None
self.address = None
self._state = None
@property
def unique_id(self):
"""Return the ZPID."""

View File

@@ -27,6 +27,7 @@ class OnOffChannel(ZigbeeChannel):
"""Initialize OnOffChannel."""
super().__init__(cluster, device)
self._state = None
self._off_listener = None
@callback
def cluster_command(self, tsn, command_id, args):
@@ -48,9 +49,12 @@ class OnOffChannel(ZigbeeChannel):
on_time = args[1]
# 0 is always accept 1 is only accept when already on
if should_accept == 0 or (should_accept == 1 and self._state):
if self._off_listener is not None:
self._off_listener()
self._off_listener = None
self.attribute_updated(self.ON_OFF, True)
if on_time > 0:
async_call_later(
self._off_listener = async_call_later(
self.device.hass,
(on_time / 10), # value is in 10ths of a second
self.set_to_off
@@ -61,6 +65,7 @@ class OnOffChannel(ZigbeeChannel):
@callback
def set_to_off(self, *_):
"""Set the state to off."""
self._off_listener = None
self.attribute_updated(self.ON_OFF, False)
@callback

View File

@@ -93,6 +93,8 @@ class ZHAGateway:
init_tasks = []
for device in self.application_controller.devices.values():
if device.nwk == 0x0000:
continue
init_tasks.append(self.async_device_initialized(device, False))
await asyncio.gather(*init_tasks)

View File

@@ -142,8 +142,8 @@ class ZhaDeviceEntity(ZhaEntity):
"""Get the latest battery reading from channels cache."""
battery = await self._battery_channel.get_attribute_value(
'battery_percentage_remaining')
if battery is not None:
# per zcl specs battery percent is reported at 200% ¯\_(ツ)_/¯
# per zcl specs battery percent is reported at 200% ¯\_(ツ)_/¯
if battery is not None and battery != -1:
battery = battery / 2
battery = int(round(battery))
self._device_state_attributes['battery_level'] = battery

View File

@@ -4,7 +4,7 @@
"documentation": "https://www.home-assistant.io/components/zha",
"requirements": [
"bellows-homeassistant==0.7.3",
"zha-quirks==0.0.12",
"zha-quirks==0.0.13",
"zigpy-deconz==0.1.4",
"zigpy-homeassistant==0.3.3",
"zigpy-xbee-homeassistant==0.2.1"

View File

@@ -24,6 +24,13 @@ def pass_through_formatter(value):
return value
def illuminance_formatter(value):
"""Convert Illimination data."""
if value is None:
return None
return round(pow(10, ((value - 1) / 10000)), 1)
def temperature_formatter(value):
"""Convert temperature data."""
if value is None:
@@ -58,6 +65,7 @@ FORMATTER_FUNC_REGISTRY = {
TEMPERATURE: temperature_formatter,
PRESSURE: pressure_formatter,
ELECTRICAL_MEASUREMENT: active_power_formatter,
ILLUMINANCE: illuminance_formatter,
GENERIC: pass_through_formatter,
}

View File

@@ -2,7 +2,7 @@
"""Constants used by Home Assistant components."""
MAJOR_VERSION = 0
MINOR_VERSION = 93
PATCH_VERSION = '0b2'
PATCH_VERSION = '1'
__short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION)
__version__ = '{}.{}'.format(__short_version__, PATCH_VERSION)
REQUIRED_PYTHON_VER = (3, 5, 3)

View File

@@ -563,7 +563,7 @@ hole==0.3.0
holidays==0.9.10
# homeassistant.components.frontend
home-assistant-frontend==20190510.0
home-assistant-frontend==20190514.0
# homeassistant.components.zwave
homeassistant-pyozw==0.1.4
@@ -797,7 +797,7 @@ oemthermostat==1.1
onkyo-eiscp==1.2.4
# homeassistant.components.onvif
onvif-zeep-async==0.1.3
onvif-zeep-async==0.2.0
# homeassistant.components.openevse
openevsewifi==0.4
@@ -1851,7 +1851,7 @@ zengge==0.2
zeroconf==0.22.0
# homeassistant.components.zha
zha-quirks==0.0.12
zha-quirks==0.0.13
# homeassistant.components.zhong_hong
zhong_hong_hvac==1.0.9

View File

@@ -145,7 +145,7 @@ hdate==0.8.7
holidays==0.9.10
# homeassistant.components.frontend
home-assistant-frontend==20190510.0
home-assistant-frontend==20190514.0
# homeassistant.components.homekit_controller
homekit[IP]==0.14.0

View File

@@ -147,7 +147,7 @@ DEMO_DEVICES = [{
'action.devices.traits.Modes'
],
'type':
'action.devices.types.MEDIA',
'action.devices.types.SWITCH',
'willReportState':
False
}, {
@@ -162,7 +162,7 @@ DEMO_DEVICES = [{
'action.devices.traits.Modes'
],
'type':
'action.devices.types.MEDIA',
'action.devices.types.SWITCH',
'willReportState':
False
}, {
@@ -171,7 +171,7 @@ DEMO_DEVICES = [{
'name': 'Lounge room'
},
'traits': ['action.devices.traits.OnOff', 'action.devices.traits.Modes'],
'type': 'action.devices.types.MEDIA',
'type': 'action.devices.types.SWITCH',
'willReportState': False
}, {
'id':
@@ -182,7 +182,7 @@ DEMO_DEVICES = [{
'traits':
['action.devices.traits.OnOff', 'action.devices.traits.Volume'],
'type':
'action.devices.types.MEDIA',
'action.devices.types.SWITCH',
'willReportState':
False
}, {

View File

@@ -686,7 +686,7 @@ async def test_device_class_cover(hass, device_class, google_type):
@pytest.mark.parametrize("device_class,google_type", [
('non_existing_class', 'action.devices.types.MEDIA'),
('non_existing_class', 'action.devices.types.SWITCH'),
('speaker', 'action.devices.types.SPEAKER'),
('tv', 'action.devices.types.TV'),
])

View File

@@ -139,7 +139,7 @@ async def async_test_pressure(hass, device_info):
async def async_test_illuminance(hass, device_info):
"""Test illuminance sensor."""
await send_attribute_report(hass, device_info["cluster"], 0, 10)
assert_state(hass, device_info, '10', 'lx')
assert_state(hass, device_info, '1.0', 'lx')
async def async_test_metering(hass, device_info):