Compare commits

...

485 Commits

Author SHA1 Message Date
Paulus Schoutsen 4ead87270e Bumped version to 0.108.0b2 2020-04-03 10:48:05 -07:00
Bram Kragten 1634592d90 Updated frontend to 20200403.0 (#33586) 2020-04-03 10:46:55 -07:00
Bram Kragten ddddd8566d Add default delay to Harmony config entries (#33576) 2020-04-03 10:46:24 -07:00
Franck Nijhof 5cf2043c04 Bump adguardhome to 0.4.2 (#33575) 2020-04-03 10:46:23 -07:00
Jc2k 43777ace20 Fix browsing regression (#33572) 2020-04-03 10:46:22 -07:00
Maciej Bieniek a7e5cc31c3 Bump gios library to version 0.1.1 (#33569) 2020-04-03 10:46:22 -07:00
Maciej Bieniek aa6520cac1 Fix source name (#33565) 2020-04-03 10:46:21 -07:00
Fabian Affolter af10cd315e Upgrade luftdaten to 0.6.4 (#33564) 2020-04-03 10:46:20 -07:00
Eugenio Panadero ef28bcaa9c Identify cameras in error logs for generic and mjpeg cameras (#33561) 2020-04-03 10:46:19 -07:00
jjlawren ff3bfade31 Plex followup to #33542 (#33558) 2020-04-03 10:46:18 -07:00
J. Nick Koston 4eafd8adf7 Add missing flow_title to doorbird (#33557)
When placeholders are in use, flow_title needs to be
set in the json to prevent an empty name in the
integrations dashboard. This affected doorbirds
that were found via ssdp.
2020-04-03 10:46:17 -07:00
Paulus Schoutsen cb5de0e090 Convert TTS tests to async (#33517)
* Convert TTS tests to async

* Address comments
2020-04-03 10:46:17 -07:00
ollo69 254394ecab Fix asuswrt network failure startup (#33485)
* Fix network failure startup

Fix for issue ##33284 - Asuswrt component fail at startup after power failure

* Removed comment

* Removed bare except

* is_connected moved out try-catch

* Removed pointless-string-statement

* Raise PlatformNotReady on "not is_connected"

* Removed unnecessary check

* Revert "Removed unnecessary check"

This reverts commit a2ccddab2c4b1ba441f1d7482d802d9774527a26.

* Implemented custom retry mechanism

* Fix new line missing

* Fix formatting

* Fix indent

* Reviewed check

* Recoded based on tibber implementation

* Formatting review

* Changes requested

* Fix tests for setup retry

* Updated missing test

* Fixed check on Tests

* Return false if not exception

* Format correction
2020-04-03 10:46:16 -07:00
J. Nick Koston e4e0c37a8c Use homekit service callbacks for lights to resolve out of sync states (#32348)
* Switch homekit lights to use service callbacks

Service callbacks allow us to get the on/off, brightness, etc
all in one call so we remove all the complexity that was
previously needed to handle the out of sync states

We now get the on event and brightness event at the same time
which allows us to prevent lights from flashing up to 100%
before the requested brightness.

* Fix STATE_OFF -> STATE_ON,brightness:0
2020-04-03 10:46:15 -07:00
Paulus Schoutsen e27d5cd9fb Bumped version to 0.108.0b1 2020-04-02 17:12:52 -07:00
Chris Talkington 6f449cd383 Update to pyipp==0.8.3 (#33554)
* Update manifest.json

* Update requirements_all.txt

* Update requirements_test_all.txt
2020-04-02 17:10:42 -07:00
Chris Talkington d47cef4ba2 Bump pyipp to 0.8.2 (#33544) 2020-04-02 17:10:41 -07:00
jjlawren a8da03912e Temporary Plex play_media workaround (#33542)
* Temporary playMedia() workaround on plexapi 3.3.0

* Use constants for strings

* Style cleanup
2020-04-02 17:10:40 -07:00
Paulus Schoutsen 8f233b822f Mark new gate device class as 2FA (#33541) 2020-04-02 17:10:40 -07:00
J. Nick Koston 060c6c89e3 Bump HAP-python to 2.8.0 (#33539) 2020-04-02 17:10:39 -07:00
J. Nick Koston 96dc0319d8 Ensure harmony hub is ready before importing (#33537)
If the harmony hub was not ready for connection or
was busy when importing from yaml, the import validation
would fail would not be retried.

To mitigate this scenario we now do the validation in
async_setup_platform which allows us to raise
PlatformNotReady so we can retry later.
2020-04-02 17:10:38 -07:00
Erik Montnemery 08b0c1178b Fix MQTT cleanup regression from #32184. (#33532) 2020-04-02 17:10:37 -07:00
Martin Hjelmare 252c724602 Clarify light reproduce state deprecation warning (#33531) 2020-04-02 17:10:37 -07:00
Maciej Bieniek c529bcca9b Bump brother to 0.1.11 (#33526) 2020-04-02 17:10:36 -07:00
Chris Talkington 9b94d128ad Update to roku==4.1.0 (#33520)
* Update manifest.json

* Update requirements_test_all.txt

* Update requirements_all.txt
2020-04-02 17:10:36 -07:00
AJ Schmidt 9c224e0515 Remove extraneous parameter from AlarmDecoder services (#33516) 2020-04-02 17:10:35 -07:00
cgtobi 899e7bfb5a Fix netatmo device unavailable and services (#33509)
* Handle unavailabe entities

* Remove some logging

* Set valve to lowest temp when turned off

* Remove some logging

* Address comments

* Report entity as connected if update is successful

* Fix stupidness

* Fix
2020-04-02 17:10:34 -07:00
Jonathan Keljo ef5f4b2aca Enable sisyphus to recover from bad DNS without restart (#32846) 2020-04-02 17:10:33 -07:00
Franck Nijhof e86fb3fc5c Bumped version to 0.108.0b0 2020-04-01 20:49:35 +02:00
Paulus Schoutsen c63ec698a1 Update translations 2020-04-01 11:43:30 -07:00
Eugenio Panadero 71aaf2d809 Add device triggers for Hue remotes (#33476)
* Store device_registry entry id in HueEvent

so it can be retrieved with that key when using device triggers

* Add device_trigger for hue_event from hue remotes

* supporting Hue dimmer switch & Hue Tap
* State mapping and strings are copied from deCONZ

* refactor mock_bridge for hue tests

and also share `setup_bridge_for_sensors`
for test_sensor_base and test_device_trigger.

* Add tests for device triggers with hue remotes

* Remove some triggers
2020-04-01 11:42:22 -07:00
Bram Kragten 400602a8b3 Updated frontend to 20200401.0 (#33505) 2020-04-01 11:27:01 -07:00
J. Nick Koston 4a32a0f1da Expand network util to check for link local addresses (#33499) 2020-04-01 11:24:30 -07:00
springstan 0cf9268ca8 Fix invalid directory for dnsmasq files in asuswrt (#33503) 2020-04-01 11:04:44 -07:00
Erik Montnemery fb93b79b12 Add MQTT debug info (#33461)
* Add MQTT debug info

* Tweaks

* Tweaks
2020-04-01 10:00:40 -07:00
Alexei Chetroi eff9b2a1a0 Clean up ZHA channel reporting configuration (#33497) 2020-04-01 11:35:48 -04:00
Ziv 4dbbf93af9 Replace asyncio.wait with asyncio.gather since wait ignores exceptions (#33380)
* replace asyncio.wait with asyncio.gather since wait ignores exceptions
fix for test_entity_platform so it expects the exception

* changed to log on failed domains

* discovered that this fix actually removes other uncaught exceptions

* fix in the list of ignored exceptions

* replaced a few ignores on dyson tests that work locally but fail in the CI

* two more tests that are failing on the CI and not locally

* removed assertion on multiple entries with same unique_id - replaced with log and return
reverted test_entity_platform to its original since now there is no exception thrown

* entered all the dyson tests. they all pass locally and probabilistically fail in the CI

* removed unnecessary str() for exception

* added log message for duplicate entity_id / unique_id

* removed log in case of False return value

* added exc_info

* change the use of exc_info
2020-04-01 07:09:13 -07:00
David F. Mulcahey 3d73f166be Correct issue on new device joins in ZHA (#33470) 2020-04-01 14:41:16 +02:00
Alexei Chetroi 0e6aacb440 Bump up zha dependencies. (#33488) 2020-03-31 23:33:05 -04:00
J. Nick Koston cc443ff37a Add config flow for nut (#33457)
* Convert nut to config flow

* Add a test for importing

* lint

* Address review items (part 1)

* Address review items (part 1)

* Cleanup unique id handling

* Update tests for new naming scheme

* No unique id, no device_info

* Remove sensor types

* Update tests to use resources that still exist
2020-03-31 19:08:27 -07:00
HomeAssistant Azure 2cfa0af532 [ci skip] Translation update 2020-04-01 00:05:04 +00:00
Chris Talkington 83fb5e5071 Apply recommendations from IPP review (#33477)
* Update test_config_flow.py

* Update test_config_flow.py

* lint.
2020-03-31 16:40:07 -07:00
Kit Klein 955c94e313 allow overriding host api url in config flow (#33481)
* allow overriding host api url in config flow

* fix typo

* capitalize URL
2020-03-31 15:50:37 -07:00
Chris Talkington b892dbc6ea Refactor DirecTV Integration to Async (#33114)
* switch to directv==0.1.1

* work on directv async.

* Update const.py

* Update __init__.py

* Update media_player.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update media_player.py

* Update test_config_flow.py

* Update media_player.py

* Update media_player.py

* work on tests and coverage.

* Update __init__.py

* Update __init__.py

* squash.
2020-03-31 15:35:32 -07:00
J. Nick Koston 3566803d2e Fix setting zone overlays for tados that support swing (#33439)
* Fix setting zone overlays for tados that support swing

* Support for changing swing mode will come at a later
time as another upstream update is required.

* remove debug

* style
2020-03-31 17:29:45 -05:00
Ron Klinkien 774b1d1663 Enable KNX tunnel auto_reconnect by default (#33387)
* Added tunnel reconnect functionality

* Code improvements

* Update homeassistant/components/knx/__init__.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Enable auto_reconnect for tunnels by default

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-04-01 00:22:20 +02:00
J. Nick Koston 90dd796644 Prepare rachio for cloudhooks conversion (#33422)
Reorganize code in order to prepare for webhooks
2020-03-31 14:46:30 -07:00
J. Nick Koston a473ae6711 Ignore link local addresses during doorbird ssdp config flow (#33401) 2020-03-31 14:20:29 -07:00
Chris Caron be99f3bf32 Bumped Apprise version to v0.8.5 (#33473) 2020-03-31 22:30:27 +02:00
Raman Gupta 5047635224 update VIZIO name to match brand guidelines (#33465) 2020-03-31 22:28:08 +02:00
J. Nick Koston e6ed2f0377 Add version and device type to powerwall device_info (#33453)
* Add version and device type to powerwall device_info

* Upstream powerwall now supports a http_session
2020-03-31 12:55:50 -07:00
Franck Nijhof b88f56cbfb Merge branch 'master' into dev 2020-03-31 21:07:45 +02:00
Paulus Schoutsen 06216a8a45 Google Assistant: parallize as many requests as possible (#33472)
* Google Assistant: parallize as many requests as possible

* Fix double comment
2020-03-31 12:01:31 -07:00
J. Nick Koston f085a0c54a Retry sense setup later if listing devices times out. (#33455) 2020-03-31 11:59:03 -07:00
J. Nick Koston b783aab41b Add binary sensor for myq gateway connectivity (#33423) 2020-03-31 11:58:44 -07:00
J. Nick Koston 12b408219e Improve handling of nuheat switching states (#33410)
* The api reports success before the state change
takes effect

* We now set state optimistically and followup with
an update 4 seconds in the future after any state change to
verify it actually happens.

* When hvac_mode is passed to the set_temperature service
we now switch to the desired mode.
2020-03-31 11:55:13 -07:00
J. Nick Koston 6cafc9aaef Add humidity support to homekit thermostats (#33367) 2020-03-31 11:45:33 -07:00
Eugenio Panadero f5cbc9d208 Fire events for hue remote buttons pressed (#33277)
* Add remote platform to hue integration

supporting ZGPSwitch, ZLLSwitch and ZLLRotary switches.

* Ported from custom component Hue-remotes-HASS from @robmarkcole

* Add options flow for hue, to toggle handling of sensors and remotes

* Sensors are enabled by default, and remotes are disabled,
  to not generate any breaking change for existent users.
  Also, when linking a new bridge these defaults are used,
  so unless going explicitly to the Options menu,
  the old behavior is preserved.
* SensorManager stores the enabled platforms and ignores everything else.
* Bridge is created with flags for `add_sensors` and `add_remotes`,
  and uses them to forward entry setup to only the enabled platforms.
* Update listener removes disabled kinds of devices when options are changed,
  so device list is in sync with options, and disabled kinds disappear from HA,
  leaving the enable/disable entity option for individual devices.

* Fix hue bridge mock with new parameters

* Revert changes in hue bridge mock

* Remove OptionsFlow and platform flags

* Extract `GenericHueDevice` from `GenericHueSensor`

to use it as base class for all hue devices, including those without any entity,
like remotes without battery.

* Add `HueBattery` sensor for battery powered remotes

and generate entities for TYPE_ZLL_ROTARY and TYPE_ZLL_SWITCH remotes.

* Remove remote platform

* Add HueEvent class to fire events for button presses

* Use `sensor.lastupdated` string to control state changes
* Event data includes:
  - "id", as pretty name of the remote
  - "unique_id" of the remote device
  - "event", with the raw code of the pressed button
    ('buttonevent' or 'rotaryevent' property)
  - "last_updated", with the bridge timestamp for the button press
* Register ZGP_SWITCH, ZLL_SWITCH, ZLL_ROTARY remotes

* fix removal

* Exclude W0611

* Extract GenericHueDevice to its own module

and solve import tree, also fixing lint in CI

* Store registered events to do not repeat device reg

* Minor cleaning

* Add tests for hue_event and battery entities for hue remotes
2020-03-31 10:27:30 -07:00
Jeff McGehee dd1608db0d Best effort state initialization of bayesian binary sensor (#30962)
* Best effort state initialization of bayesian binary sensor.

Why:

* https://github.com/home-assistant/home-assistant/issues/30119

This change addresses the need by:

* Running the main update logic eagerly for each entity being observed
  on `async_added_to_hass`.
* Test of the new behavior.

* Refactor in order to reduce number of methods with side effects that
mutate instance attributes.

* Improve test coverage

Why:

* Because for some reason my commits decreased test coverage.

This change addresses the need by:

* Adding coverage for the case where a device returns `STATE_UNKNOWN`
* Adding coverage for configurations with templates

* rebase and ensure upstream tests passed

* Delete commented code from addressing merge conflict.
2020-03-31 10:41:29 -06:00
Eugenio Panadero f2f03cf552 Fix deconz tests that have uncaught exceptions (#33462) 2020-03-31 11:19:34 -05:00
Eugenio Panadero 977f1a6916 Fix hue tests that have uncaught exceptions (#33443) 2020-03-31 10:17:09 -05:00
Bram Kragten ffefdcfe22 Require admin to manage lovelace (#33435) 2020-03-31 11:43:21 +02:00
Franck Nijhof f4eb1f0652 Update issue templates (#33434)
* Update issue templates

* Process review suggestions
2020-03-31 11:31:43 +02:00
Aaron Bach 23668f3c5e Overhaul the Slack integration (async and Block Kit support) (#33287)
* Overhaul the Slack integration

* Docstring

* Empty commit to re-trigger build

* Remove remote file option

* Remove unused function

* Adjust log message

* Update homeassistant/components/slack/notify.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Code review

* Add deprecation warning

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-03-30 21:32:29 -06:00
Marcel Steinbach 6208d8c911 Add HomeKit support for slat tilting (#33388)
* Add HomeKit support for slat tilting

* Reset tilt-specific attribute, not position attribute

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Add explanation why we fix HomeKit's targets

We have to assume that the device has worse precision than HomeKit. If it
reports back a state that is only _close_ to HK's requested state, we'll
"fix" what HomeKit requested so that it won't appear out of sync.

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-03-30 19:47:03 -05:00
David F. Mulcahey d0dad4bfd6 Fix uncaught exceptions in ZHA tests (#33442) 2020-03-30 20:34:23 -04:00
Balazs Sandor 7330e30fd3 bump version zigpy-cc (#33448) 2020-03-30 20:33:07 -04:00
Franck Nijhof a9cbd355ca Correct FortiOS integration name in manifest (#33454) 2020-03-30 17:20:37 -07:00
HomeAssistant Azure 3e0eaa3c87 [ci skip] Translation update 2020-03-31 00:02:51 +00:00
Chris Talkington 98f68f4798 Add Internet Printing Protocol (IPP) integration (#32859)
* Create __init__.py

* Create manifest.json

* Update zeroconf.py

* more work on integration

* more work on integration.

* add more sensor tests.

* Update const.py

* Update sensor.py

* more work on ipp.

* Update test_config_flow.py

* more work on ipp.

* Update config_flow.py

* Update config_flow.py
2020-03-30 16:13:47 -07:00
evoblicec 0e3c1dc031 Add new mapped weather condition classes to Météo France (#33450)
* Update Meteo_France Weather constants

Updating Meteo_France integration with more weather "condition" returned by the web service.

Adding: 
- "Nuit claire" (note the lower 'c') mapped to "clear-night"
- "Brume" mapped to "fog"

* Black formatting update
2020-03-31 00:05:18 +02:00
Erik Montnemery 9508c51403 Fix change of entity_id for discovered MQTT entities (#33444) 2020-03-30 14:26:59 -07:00
Bram Kragten 531207e005 Updated frontend to 20200330.0 (#33449) 2020-03-30 14:20:14 -07:00
Bram Kragten 952aa02e37 Add ability to specify group when creating user (#33373)
* Add abbility to specify group when creating user

* Fix tests

* Not default admin and tests
2020-03-30 20:33:43 +02:00
Bas Nijholt 3e0ccd2e86 Add KEF services for DSP (#31967)
* add services for DSP

* add homeassistant/components/kef/const.py

* add services.yaml

* fix set_mode

* fix services

* media_player.py fixes

* bump aiokef to 0.2.9

* update requirements_all.txt

* add basic sensor.py

* add DSP settings as attributes

* add message about kef.update_dsp

* remove sensor.py

* fix pylint issues

* update_dsp inside async_added_to_hass

* use {...} instead of dict(...)

* get DSP settings when connecting to HA or once on update

* simplify condition

* do not get mode twice

* remove async_added_to_hass

* use async_register_entity_service

* remove entity_id from schema and prepend _value

* invalidate self._dsp after setting a DSP setting

* schedule update_dsp every hour

* subscribe and unsubscribe on adding and removing to HA

* don't pass hass and set _update_dsp_task_remover to None after removing
2020-03-30 10:45:24 -07:00
David F. Mulcahey bcd1eb952c RFC - Add a 3rd state to the HA shutdown sequence for writing… (#33358)
* add third stage to hass shutdown

* use 3rd stage in storage

* update core state

* add writing data to multi stop ignore

* update core test

* review comment

* update name based on feedback
2020-03-30 10:18:39 -07:00
da-anda 01bf4daf37 Fix detection of zone master in soundtouch media_player (#33157) 2020-03-30 17:27:02 +02:00
Santobert 0186ce7896 Filter the history of device_tracker by location attributes (#33356)
* Add include_location_attributes

* Add check for different state

* Fix things

* Drop filter

* significant changes only

* Change default behavior

* Remove trailing commas
2020-03-30 08:13:22 -07:00
J. Nick Koston f42804805c Move Tado zone state handling into upstream python-tado library (#33195)
* Tado climate state moved to python-tado

* Resolve various incorrect states and add tests for known tado zone states

* Write state instead of calling for an update

This is a redux of pr #32564 with all of the zone state now moved into
python-tado and tests added for the various states.

* stale string

* add missing undos to dispachers

* remove unneeded hass

* naming

* rearrange

* fix water heater, add test

* fix water heater, add test

* switch hvac mode when changing temp if in auto/off/smart
2020-03-30 09:06:26 -05:00
vwir eee0a6e9f4 Fix for nissan_leaf component getting stuck (#33425)
* Fix for nissan_leaf component getting stuck

* Remove dots from error messages in nissan_leaf component
2020-03-30 09:35:50 +02:00
Kit Klein 0e6b905cdf Add konnected multi output (#33412)
* add test to for importing multiple output settings

* provide option to set multiple output states

* tweaks after testing

* Update homeassistant/components/konnected/config_flow.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-29 20:05:59 -07:00
J. Nick Koston d59209ff47 Prevent nut from doing I/O in the event loop (#33420)
* Prevent nut from doing I/O in the event loop

device_state_attributes would call for an update if the
throttle happened to expire.

* _format_display_state no self use
2020-03-29 20:53:25 -05:00
jan iversen ad8cf2d0d0 Remove Modbus legacy code (#33407)
* Modbus: remove legacy code

flexit and stiebel_el are updated to import modbus.const,
therefore legacy code can be removed.

* Flexit: update const reference from modbus

climate.py imports from modbus direct, this is legacy and will
result in errors.

update import to be modbus.const.

* Stiebel_el: update reference to modbus

__init.py references modbus directly, this is legacy and will
give errors.

Update import to be modbus.const.
2020-03-30 01:35:58 +02:00
Aaron Bach fe0db80fb8 Bump aioambient to 1.1.0 (#33414) 2020-03-30 00:28:37 +02:00
David F. Mulcahey ef61118d49 fix ZHA IASWD commands (#33402) 2020-03-29 17:42:37 -04:00
Malte Franken de54659097 Fix GeoNet NZ Quakes tests (#33383)
* enable tests

* only remove entity if exists
2020-03-29 22:40:09 +02:00
Jc2k ad3c5240c2 Bump aiohomekit version to fix Ecobee Switch (#33396) 2020-03-29 22:38:52 +02:00
Anders Liljekvist 0f9790f5f1 Bluesound volume stepper bugfix (#33404) 2020-03-29 22:38:03 +02:00
jjlawren 68e86c5e3a Handle Ecobee service timeouts (#33381)
* Bump pyecobee to 0.2.4

* Bump pyecobee to 0.2.5
2020-03-29 22:15:12 +02:00
SukramJ 1cd0e764b6 Use new HMIP labels for HomematicIP Cloud multi devices (#32925)
* Use new labels for HomematicIP Cloud multi devices

* Update homeassistant/components/homematicip_cloud/device.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Update name composition

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-03-29 21:38:59 +02:00
cgtobi d45c386149 Bump opencv to 4.2.0.32 (#33391)
* Bump opencv to 4.2.0.32
2020-03-29 21:30:00 +02:00
jan iversen dd3cd95954 Modbus patch, to allow communication with "slow" equipment using tcp (#32557)
* modbus: bumb pymodbus version to 2.3.0

pymodbus version 1.5.2 did not support asyncio, and in general
the async handling have been improved a lot in version 2.3.0.

updated core/requirement*txt

* updated core/CODEOWNERS

committing result of 'python3 -m script.hassfest'.

* modbus: change core connection to async

change setup() --> async_setup and update() --> async_update()

Use async_setup_platform() to complete the async connection to core.

listen for EVENT_HOMEASSISTANT_START happens in async_setup()
so it needs to be async_listen.

But listen for EVENT_HOMEASSISTANT_STOP happens in start_modbus()
which is a sync. function so it continues to be listen().

* modbus: move setup of pymodbus into modbushub

setup of pymodbus is logically connected to the class modbushub,
therefore move it into the class.

Delay construction of pymodbus client until event
EVENT_HOMEASSISTANT_START arrives.

* modbus: use pymodbus async library

convert pymodbus calls to refer to the async library.

Remark: connect() is no longer needed, it is done when constructing
the client. There are also automatic reconnect.

* modbus: use async update for read/write

Use async functions for read/write from pymodbus.

change thread.Lock() to asyncio.Lock()

* Modbus: patch for slow tcp equipment

When connecting, via Modbus-TCP, so some equipment (like the
huawei sun2000 inverter), they need time to prepare the protocol.

Solution is to add a asyncio.sleep(x) after the connect() and before
sending the first message.

Add optional parameter "delay" to Modbus configuration.
Default is 0, which means do not execute asyncio.sleep().

* Modbus: silence pylint false positive

pylint does not accept that a class construction __new__
can return a tuple.

* Modbus: move constants to const.py

Create const.py with constants only used in
the modbus integration.

Duplicate entries are removed, but NOT any entry that would
lead to a configuration change.

Some entries were the same but with different names, in this
case renaming is done.

Also correct the tests.

* Modbus: move connection error handling to ModbusHub

Connection error handling depends on the hub, not the
entity, therefore it is logical to have the handling in
ModbusHub.

All pymodbus call are added to 2 generic functions (read/write)
in order not to duplicate the error handling code.

Added property "available" to signal if the hub is connected.

* Modbus: CI cleanup

Solve CI problems.

* Modbus: remove close of client

close() no longer exist in the pymodbus library, use
del client instead.

* Modbus: correct review comments

Adjust code based on review comments.

* Modbus: remove twister dependency

Pymodbus in asyncio mode do not use twister but still throws a
warning if twister is not installed, this warning goes into
homeassistant.log and can thus cause confusion among users.

However installing twister just to avoid the warning is not
the best solution, therefore removing dependency on twister.

* Modbus: review, remove comments.

remove commented out code.
2020-03-29 12:39:30 -05:00
David F. Mulcahey 188ca630de Miscellaneous ZHA code cleanup (#33395)
* cleanup state change listener

* update group id handling and unique id

* update test

* add guards for last_seen updates
2020-03-29 13:26:48 -04:00
jjlawren ffafcf27a8 plexwebsocket bump 0.0.7 to fix ignored tests (#33398)
* Bump plexwebsocket to 0.0.7

* Remove unnecessary test ignores
2020-03-29 12:14:42 -04:00
tiagofreire-pt 21098bc3e5 Upgrade broadlink to 0.13.0 (#33240)
* Upgrading the broadlink library version to 0.13.0

As stated here: https://pypi.org/project/broadlink/

* Update requirements_test_all.txt

* Update requirements_all.txt

* Delete requirements_test_all.txt

* Revert "Delete requirements_test_all.txt"

This reverts commit 008f6f2030.

* Revert "Revert "Delete requirements_test_all.txt""

This reverts commit 73e22fd0ff.

* Revert "Revert "Revert "Delete requirements_test_all.txt"""

This reverts commit 7662119c89.
2020-03-29 13:03:46 +02:00
bangom 1f9f5bfaa8 Fix wrong SI unit_prefix in Integration component (#33227) (#33228)
* wrong SI metric prefixes
2020-03-29 11:17:53 +01:00
jjlawren 312af53935 Handle Plex certificate updates (#33230)
* Handle Plex certificate updates

* Use exception in place

* Add test
2020-03-28 21:02:29 -07:00
SukramJ 3c2df7f8f2 Fix homematicip_cloud tests that have uncaught exceptions (#33371) 2020-03-28 21:01:53 -07:00
Colin Harrington 42cb5a5239 Calculate Plum Lightpad brightness and glowIntensity correctly (#33352)
* Plum Lightpad - glowIntensity is represented as a float/percentage
Calculate brightness from the glowIntensity instead of the glowIntensity from brightness.

* Renamed `_glowIntensity` to `_glow_intensity`

* Added Rounding, converting to an int, min and max boxing

* Added codeowners to the Plum Lightpad manifest.json
2020-03-28 21:01:22 -07:00
Austin Mroczek d832ce0b26 Fix openweathermap sensor.py so no KeyError if raining is miss… (#33372) 2020-03-28 20:59:57 -07:00
Richard de Boer f32ae95ef4 Fix media_player supported features default value (#33366)
I looked at all media_player components and these were the only ones returning None:
- bluesound
- emby
- mpd
2020-03-28 20:59:04 -07:00
Maciej Bieniek de2f506585 Migrate GIOS to use DataUpdateCoordinator (#33306)
* Migrate to DataUpdateCoordinator

* Simplify code
2020-03-28 20:57:06 -07:00
David F. Mulcahey f7ae78f78e Update ZHA group entity when Zigbee group membership changes (#33378)
* cleanup group entities

* add test

* appease pylint

* fix order
2020-03-28 20:38:48 -04:00
HomeAssistant Azure 5bedc4ede2 [ci skip] Translation update 2020-03-29 00:04:45 +00:00
Anders Melchiorsen 03a090e384 Fixes for Sonos media position (#33379) 2020-03-28 16:15:32 -07:00
Ziv dd232a3507 Fix uncaught exceptions in dynalite (#33374) 2020-03-28 22:19:43 +01:00
Colin Harrington 03a9e3284c Fix broken supported_features in Plum Lightpad (#33319) 2020-03-28 21:21:28 +01:00
Malte Franken c08ca8a439 Fix GDACS tests (#33357)
* enable tests

* only remove entity if exists
2020-03-28 21:18:15 +01:00
shred86 bf16b50679 Fix Abode tests uncaught exceptions (#33365) 2020-03-28 18:54:07 +01:00
J. Nick Koston 5a1b0edd96 Add inline comments to elkm1 about how config is updated from… (#33361) 2020-03-28 17:23:39 +01:00
Bram Kragten 1477087c71 Fix Lovelace resources health info (#33309)
* Fix Lovelace resources health info

* Fix tests
2020-03-28 13:57:36 +01:00
Hans Oischinger 4a2236fe85 :vicare: Improve scan_interval (#33294)
This upgrades to PyVicare 0.1.10 which allows to combine multiple
requests into a single HTTP GET. This in turn allows us to increase
the scan_interval to 60 seconds by default.
Additionally scan_interval has been introduced as a config parameter.
2020-03-28 12:12:27 +01:00
J. Nick Koston 95cefd1acc Fix nuheat unexpectedly switching to a permanent hold (#33316)
When in run schedule mode, setting the temperature will switch
the device to a temporary hold.  If you set the temperature
again, we should stay in temporary hold mode and not switch
to permanent hold.

The underlying nuheat package contains a default to a
permanent hold if no setting was passed.  We now always
pass the setting.
2020-03-27 23:01:59 -07:00
David F. Mulcahey 5ce31cb383 Fix ZHA light group on state (#33308) 2020-03-27 23:01:17 -07:00
Ziv ff391e538a Fail tests with uncaught exceptions (#33312)
* initial implementation and ignore file

* updated ignore list for the tests in the most recent dev branch
2020-03-27 21:36:06 -07:00
ochlocracy 28a2c9c653 Implement Alexa.CameraStreamController in Alexa (#32772)
* Implement Alexa.CameraStreamController.

* Add dependencies.

* Add camera helpers for image url, and mjpeg url.

* Remove unsupported AlexaPowerController from cameras.

* Refactor camera_stream_url to hass_url

* Declare HLS instead of RTSP.

* Add test for async_get_image_url() and async_get_mpeg_stream_url().

* Sort imports.

* Fix camera.options to camera.stream_options. (#32767)


(cherry picked from commit 9af95e8577)

* Remove URL configuration option for AlexaCameraStreamController.

* Update test_initialize_camera_stream.

* Optimize camera stream configuration.

* Update Tests for optimized camera stream configuration.

* Sort imports.

* Add check for Stream integration.

* Checks and Balances.

* Remove unnecessary camera helpers.

* Return None instead of empty list for camera_stream_configurations().
2020-03-27 21:19:11 -07:00
J. Nick Koston 369ffe2288 Fix setting HomeKit temperatures with imperial units (#33315)
In PR#24804 the step size was changed to match the step size
of the device that HomeKit is controlling. Since HomeKit
is always working in TEMP_CELSIUS and the step size is based on
the Home Assistant units setting, we were mixing data with different
units of measure when Home Assistant was using imperial units.

This regression presented the symptom that setting the
temperature to 73F would result in 74F.  Other values are affected
where the math doesn't happen to work out.

HomeKit currently has a default of 0.1 in the spec and the override
of this value has been removed.
2020-03-27 21:02:51 -07:00
HomeAssistant Azure 5f72ad8da6 [ci skip] Translation update 2020-03-28 00:08:09 +00:00
J. Nick Koston 00c38c5f70 Bump nexia to 0.7.3 (#33311)
* Resolves not being able to see the compressor speed.
2020-03-27 15:40:54 -05:00
J. Nick Koston 18a4829314 Config flow for elkm1 (#33297)
* Config flow for elkm1

* As entity ids can now be changed, the “alarm_control_panel”
attribute “changed_by_entity_id” is now “changed_by_keypad”
and will show the name of the Elk keypad instead of the entity id.

* An auto configure mode has been introduced which avoids the
need to setup the complex include and exclude filters.  This
functionality still exists when configuring from yaml for power
users who want more control over which entities elkm1 generates.

* restore _has_all_unique_prefixes

* preserve legacy behavior of creating alarm_control_panels that have no linked keypads when auto_configure is False

* unroll loop
2020-03-27 15:38:35 -05:00
Adam Michaleski c629e7dc0e Add integration for Schluter (#31088)
* Add integration for Schluter
New integration for Schluter DITRA-HEAT thermostats. Interacts with Schluter API via py-schluter to implement climate platform.

* Fix for manifest issue on build
Removed unnecessary configurator logic

* Flake8 & ISort issues fixed

* Code review modifications for Schluter integration
- Removed unnecessary strings.json file
- Removed unnecessary DEFAULT_SCAN_INTERVAL from __init__.py
- Removed persistent notification for authentication error in __init__.py
- Removed string casts from log statements in __init__.py
- Removed unnecessary logging of entity creations in climate.py
- Removed unnecessary lookup for hvac_mode in climate.py

* Work started on Update Coordinator

* Further Coordinator work

* Update to DataUpdateCoordinator complete

* Flake8 fix

* Removal of unnecessary SchluterPlatformData
Coordinator also now using SCAN_INTERVAL

* Disable polling, use coordinator listeners

* Isort on climate.py

* Code review modifications
- Hass data stored under domain
- Since platform only likely to be climate, removed array, load explicitly
- Remove unnecessary fan mode implementation

* Switch to HVAC action for showing current heating status

* Isort fix

* HVAC Mode return list, set_hvac_mode function added

* __init__.py modifications from code review

* Climate.py code review modifications
- Device info property removed
- Write state function on set temp failure
- Add "available" property
- Delegate sync function in coordinator update to the executor

* Serial number as unique identifier
- Now using serial number & thermostat dictionary to protect against scenarios where a device is removed and enumerable index is no longer accurate
- Removed async_write_ha_state() from set temp exception, not needed
- Removed unnecessary SCAN_INTERVAL definition

* Linting

* Update homeassistant/components/schluter/climate.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/schluter/climate.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Changed timeout from config, load platform discover to None

* Proposed change for discover info issue

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-03-27 10:53:36 -07:00
Paulus Schoutsen 73c52e668e Fix dispatcher logging (#33299) 2020-03-26 20:44:44 -07:00
Paulus Schoutsen 6cafc45d2b Fix ZHA light crashing on color loop effect (#33298) 2020-03-26 20:23:01 -07:00
David F. Mulcahey 4f767dd3ef Add entities for ZHA fan groups (#33291)
* start of fan groups

* update fan classes

* update group entity domains

* add set speed

* update discovery for multiple entities for groups

* add fan group entity tests

* cleanup const

* cleanup entity_domain usage

* remove bad super call

* remove bad update line

* fix set speed on fan group

* change comparison

* pythonic list

* discovery guards

* Update homeassistant/components/zha/core/discovery.py

Co-Authored-By: Alexei Chetroi <lexoid@gmail.com>

Co-authored-by: Alexei Chetroi <lexoid@gmail.com>
2020-03-26 22:19:48 -04:00
HomeAssistant Azure c89975adf6 [ci skip] Translation update 2020-03-27 00:46:57 +00:00
Erik Montnemery 867630a4a7 Remove state when entity is removed from registry (#32184) 2020-03-26 16:33:50 -07:00
Bram Kragten a6d5ed0160 Add support for dashboards to lovelace cast service (#32913) 2020-03-26 16:23:46 -07:00
J. Nick Koston f93e4e3de7 Support homekit matches that have a dash after the model (#33274) 2020-03-26 15:15:35 -07:00
J. Nick Koston f5a6c3484d Abort rachio homekit config when one is already setup (#33285)
* Abort rachio homekit config when one is already setup.

We can see rachio on the network to tell them to configure
it, but since the device will not give up the account it is
bound to and there can be multiple rachio controllers on a single
account, we avoid showing the device as discovered once
they already have one configured as they can always
add a new one via "+"

* doc string freshness

* doc string freshness

* Update tests/components/rachio/test_config_flow.py

Co-Authored-By: Franck Nijhof <git@frenck.dev>

Co-authored-by: Franck Nijhof <git@frenck.dev>
2020-03-26 17:14:52 -05:00
J. Nick Koston b8afb9277a Bump nexia to 0.7.2 (#33292)
* Bump nexia to 0.7.2

* Fixes zones on the same thermostat showing as active
when the damper was closed.

* Update test for nexia 0.7.2
2020-03-26 15:14:35 -07:00
Daniel Høyer Iversen 262ed9ed2a Upgrade tibber to 0.13.6 (#33293) 2020-03-26 22:27:05 +01:00
jjlawren f1e58d0784 Handle empty Plex client username (#33271) 2020-03-26 21:18:23 +01:00
Jaryl Chng 6c6318d18f Update PySwitchbot to 0.8.0 and add password configuration option (#33252)
* Update PySwitchbot to 0.8.0 and added password configuration

* Removed unchanged retry_count attribute

* Fix dependencies and formatting

* Removed default value for password and use config.get instead
2020-03-26 20:55:00 +01:00
Kris Bennett 3dc6612cd9 Add Android TV cover art (screen content) (#33232)
* Android TV

* Android TV

* Android TV

* Android TV

* Android TV

* Android TV

* Android TV

* Android TV

* Android TV
2020-03-26 11:31:23 -07:00
Malte Franken a38db1f677 Fix GDACS integration to remove stale entities from entity registry (#33283)
* remove entities from entity registry

* added test for removing entities from entity registry
2020-03-26 19:05:48 +01:00
Fabian Affolter 558cccc68c Upgrade pyyaml to 5.3.1 (#33246) 2020-03-26 16:14:07 +01:00
Fabian Affolter b598ff94d1 Upgrade jinja2 to >=2.11.1 (#33244) 2020-03-26 16:12:12 +01:00
Fabian Affolter c267946284 Upgrade discord.py to 1.3.2 (#33280) 2020-03-26 12:58:11 +01:00
Paulus Schoutsen 07ce284acd Merge pull request #33269 from home-assistant/rc
0.107.7
2020-03-25 17:53:05 -07:00
HomeAssistant Azure 6c4b4ad1e0 [ci skip] Translation update 2020-03-26 00:47:06 +00:00
Maciej Bieniek 815d153e55 Bump gios library to version 0.0.5 (#33266) 2020-03-25 16:24:28 -07:00
Paulus Schoutsen eac03ef4be Bumped version to 0.107.7 2020-03-25 16:04:19 -07:00
jjlawren a38e075bda Schedule Unifi shutdown callback earlier (#33257) 2020-03-25 16:04:06 -07:00
J. Nick Koston cced74740f Ensure recorder event loop recovers if the database server dis… (#33253)
If the database server disconnects there were exceptions
that were not trapped which would cause the recorder event
loop to collapse.  As we never want the loop to end
we trap exceptions broadly.

Fix a bug in the new commit interval setting which caused
it to always commit after 1s
2020-03-25 16:04:05 -07:00
Alexei Chetroi 1236c2b91e Refactor ZHA platform setup (#33226)
Setup ZHA platforms only after successful gateway startup.
2020-03-25 16:04:05 -07:00
Diogo Gomes d54d7c6958 Increase timeout setting up IPMA (#33194) 2020-03-25 16:04:04 -07:00
brefra 9365ba3fcf Fix velbus dimming control (#33139)
* Fix light control

* Optimize conversion logic
2020-03-25 16:04:03 -07:00
jjlawren 5650b390b9 Schedule Unifi shutdown callback earlier (#33257) 2020-03-25 16:03:26 -07:00
Pascal Vizeli 8f4d3146c1 Revert "Fix issue with smhi-pkg" (#33259)
* Revert "Fix issue with smhi-pkg (#33248)"

This reverts commit 6990c70123.

* Bump version to 1.0.13
2020-03-25 21:43:29 +01:00
Fabian Affolter 2647296475 Refactor API documentation (#33217)
* Upgrade Sphinx to 2.4.4

* Refactor API documentation

* Remove left-over

* Remove Markdown from docstring

* Update titels
2020-03-25 13:21:04 -07:00
J. Nick Koston 6d311a31dd Ensure recorder event loop recovers if the database server dis… (#33253)
If the database server disconnects there were exceptions
that were not trapped which would cause the recorder event
loop to collapse.  As we never want the loop to end
we trap exceptions broadly.

Fix a bug in the new commit interval setting which caused
it to always commit after 1s
2020-03-25 13:08:20 -07:00
Paulus Schoutsen 4bbc0a03ca Activate asyncio debug when HA run in debug mode (#33251) 2020-03-25 13:03:56 -07:00
Maciej Bieniek 16670a38a4 Dynamic update interval for Airly integration (#31459)
* Initial commit

* dynamic update

* Don't update when add entities

* Cleaning

* Fix MAX_REQUESTS_PER_DAY const

* Fix pylint errors

* Fix comment

* Migrate to DataUpdateCoordinator

* Cleaning

* Suggested change

* Change try..except as suggested

* Remove unnecessary self._attrs variable

* Cleaning

* Fix typo

* Change update_interval method

* Add comments

* Add ConfigEntryNotReady
2020-03-25 11:13:28 -07:00
David F. Mulcahey eb8e8d00a6 Add group entities for ZHA switches (#33207) 2020-03-25 13:29:40 -04:00
Raman Gupta d5f4dfdd6b Update vizio app_id state attribute to show app config dict in… (#32727)
* bump pyvizio and update app_id to show app config to aid in HA config generation. squashed from multiple commits to make a rebase on dev easier

* bump pyvizio for bug fixes

* fix pyvizio version number

* only return app_id if app is unknown and explicitly create the dict that's returned

* fix tests

* fix docstring for app_id
2020-03-25 09:35:36 -07:00
Fabian Affolter 4a0a56ebdc Upgrade hole to 0.5.1 (#33249) 2020-03-25 17:22:34 +01:00
Pascal Vizeli 6990c70123 Fix issue with smhi-pkg (#33248)
* Fix issue with smhi-pkg

* Update azure-pipelines-wheels.yml
2020-03-25 09:19:10 -07:00
Eugenio Panadero bb68e7a532 Bump aiohue version to 2.1.0 (#33234) 2020-03-25 09:11:00 -07:00
Pascal Vizeli bb3592baa0 [skip ci] Update azure-pipelines-translation.yml for Azure Pipelines 2020-03-25 15:19:34 +01:00
Franck Nijhof 1fa996ed68 Fix ONVIF camera snapshot with auth (#33241) 2020-03-25 13:32:28 +01:00
David F. Mulcahey 2a3c94bad0 Add group entity support to ZHA (#33196)
* split entity into base and entity

* add initial light group support

* add dispatching of groups to light

* added zha group object

* add group event listener

* add and remove group members

* get group by name

* fix rebase

* fix rebase

* use group_id for unique_id

* get entities from registry

* use group name

* update entity domain

* update zha storage to handle groups

* dispatch group entities

* update light group

* fix group remove and dispatch light group entities

* allow picking the domain for group entities

* beginning - auto determine entity domain

* move methods to helpers so they can be shared

* fix rebase

* remove double init groups... again

* cleanup startup

* use asyncio create task

* group entity discovery

* add logging and fix group name

* add logging and update group after probe if needed

* test add group via gateway

* add method to get group entity ids

* update storage

* test get group by name

* update storage on remove

* test group with single member

* add light group tests

* test some light group logic

* type hints

* fix tests and cleanup

* revert init changes except for create task

* remove group entity domain changing for now

* add missing import

* tricky code saving

* review comments

* clean up class defs

* cleanup

* fix rebase because I cant read

* make pylint happy
2020-03-25 07:23:54 -04:00
Pascal Vizeli 3ee05ad4bb Enable Jemalloc for docker Core (#33237) 2020-03-25 10:14:15 +01:00
Eugenio Panadero 44425a184e Fix pre-commit hooks env for gen_requirements_all & hassfest (#33187)
* Run-in-env script.gen_requirements_all and hassfest in pre-commit

* Apply suggestions from code review and change `language` to script

Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>
2020-03-25 09:47:01 +02:00
Alexei Chetroi 28c2f9caa9 Refactor ZHA platform setup (#33226)
Setup ZHA platforms only after successful gateway startup.
2020-03-24 20:32:46 -04:00
J. Nick Koston 2a36adae46 Abort myq homekit config when one is already setup. (#33218)
We can see myq on the network to tell them to configure
it, but since the device will not give up the account it is
bound to and there can be multiple myq gateways on a single
account, we avoid showing the device as discovered once
they already have one configured as they can always
add a new one via "+"
2020-03-24 17:09:24 -07:00
brefra 46985bba0d Fix velbus dimming control (#33139)
* Fix light control

* Optimize conversion logic
2020-03-24 21:58:50 +01:00
Balazs Keresztury 3f4a7ec396 Fix minor bmp280 issues mentioned in late review (#33211)
* Fix minor issues mentioned in #30837 after it was closed

* Update homeassistant/components/bmp280/sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-24 21:52:49 +01:00
Patryk ad9f4db983 Add leak sensor support to Homekit integration (#33171)
* Add leak sensor support to Homekit integration

* Add leak entries to binary_sensor/strings.json

* Revert changes from binary_sensor

* Fix

* Review fix
2020-03-24 13:49:01 -07:00
Aaron Bach 0e2fa7700d Allow more than one AirVisual config entry with the same API k… (#33072)
* Allow more than one AirVisual config entry with the same API key

* Add tests

* Correctly pop geography

* Code review

* Code review
2020-03-24 11:39:38 -07:00
Ron Klinkien 109f083c5d Add Body Composition data to Garmin Connect (#32841)
* Added support for Garmin index smart scale

* Added body composition data

* Added keyerror exception

* Code optimization

* Update library, changed logger errors to exception

* Fixed manifest
2020-03-24 10:29:40 -07:00
Eugenio Panadero fb22f6c301 Add Context support for async_entity removal (#33209)
* Add Context for async_remove

* Check context in state automation on entity removal
2020-03-24 09:59:17 -07:00
roleo aec2fe86e4 Add onvif snapshot uri (#33149)
* Add onvif snapshot uri

If the cam supports http snapshot uri, use it instead of ffmpeg.

* Code formatting

* Fix to pass pre-commit
2020-03-24 09:57:14 -07:00
HomeAssistant Azure 763ed0dc7b [ci skip] Translation update 2020-03-24 13:18:47 +00:00
Pascal Vizeli baf7fb7264 Merge pull request #33206 from home-assistant/rc
0.107.6
2020-03-24 14:08:27 +01:00
Diogo Gomes f150c9c65c Increase timeout setting up IPMA (#33194) 2020-03-24 13:17:31 +01:00
Josef Schlehofer d979648c01 Upgrade youtube_dl to version 2020.03.24 (#33202) 2020-03-24 13:04:16 +01:00
Oliver 9226589bcd Bump to version 0.8.1 of denonavr (#33169)
* Bump to version 0.8.1 of denonavr

* Update CODEWONERS file
2020-03-24 13:03:22 +01:00
Pascal Vizeli edfe8e1583 Bump version to 0.107.6 2020-03-24 11:50:25 +00:00
Pascal Vizeli b36b1dbc70 Bump OZW fork to 0.1.10 (#33205) 2020-03-24 11:49:35 +00:00
Franck Nijhof 253c848692 Fix minut point updating frozen config entry data (#33148)
* Fix minut point updating frozen config entry data

* Update webhooks handling for configuration entry
2020-03-24 11:49:33 +00:00
Paulus Schoutsen 7a6ac578b4 Fix script logging with name (#33120) 2020-03-24 11:49:32 +00:00
Pascal Vizeli e616ab5fb2 Bump OZW fork to 0.1.10 (#33205) 2020-03-24 12:04:33 +01:00
MeIchthys 3c59791b2e Add Nextcloud Integration (#30871)
* some sensors working in homeassistant

* bring up to date

* add codeowner

* update requirements

* overhaul data imports from api & sensor discovery

* remove print statement

* delete requirements_test_all

* add requrements_test_all.txt

* Update homeassistant/components/nextcloud/sensor.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Update homeassistant/components/nextcloud/sensor.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* describe recursive function

* clarify that dict is returned

* remove requirements from requirements_test_all

* improve and simplify sensor naming

* add basic tests

* restore pre-commit config

* update requirements_test_all

* remove codespell requirement

* update pre-commit-config

* add-back codespell

* rename class variables as suggested by @springstan

* add dev branch to no-commit-to-branch git hook

Because my fork had the same 'dev' branch i wasn't able to push. Going forward I should probably name my branches differently.

* move config logic to __init__.py

* restore .pre-commit-config.yaml

* remove tests

* remove nextcloud test requirement

* remove debugging code

* implement binary sensors

* restore .pre-commit-config.yaml

* bump dependency version

* bump requirements files

* bump nextcloud reqirement to latest

* update possible exceptions, use fstrings

* add list of sensors & fix inconsistency in get_data_points

* use domain for config

* fix guard clause

* repair pre-commit-config

* Remove period from logging

* include url in unique_id

* update requirements_all.txt

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-03-24 11:11:35 +01:00
On Freund b50281a917 Options flow for Monoprice sources (#33156)
* Options flow for monoprice sources

* Fix lint errors
2020-03-23 17:32:21 -07:00
Franck Nijhof 2d002f3ef6 Fix minut point updating frozen config entry data (#33148)
* Fix minut point updating frozen config entry data

* Update webhooks handling for configuration entry
2020-03-24 01:20:39 +01:00
Oxan van Leeuwen 6180f7bd64 Fix Google Assistant temperature control for entity without mo… (#33107) 2020-03-23 16:57:26 -07:00
elmurato 45241e57ca Add support for Minecraft SRV records (#32372)
* Added support for Minecraft SRV records

* Switched from dnspython to aiodns, improved server ping and log messages, use address instead of host and port in config flow

* Updated component requirements
2020-03-23 16:51:13 -07:00
Eugenio Panadero cd57b764ce Fix state_automation_listener when new state is None (#32985)
* Fix state_automation_listener when new state is None (fix #32984)

* Listen to EVENT_STATE_CHANGED instead of using async_track_state_change

and use the event context on automation trigger.

* Share `process_state_match` with helpers/event

* Add test for state change automation on entity removal
2020-03-23 16:05:21 -07:00
Eugenio Panadero c2a9aba467 Minor changes for new pvpc_hourly_pricing integration (#33177)
* Use async_call_later for retrying, instead of async_track_point_in_time
* Normalize test filename renaming it to `test_sensor`
* Remove link to docs in docstring
* Adjust test results to new behavior with async_call_later
2020-03-23 22:45:04 +01:00
Maciej Bieniek 5c2bd8b743 Add unique ID propery to braviatv entity (#33037)
* Add unique_id property

* Use cid to generate unique_id

* Remove debug file

* Add _unique_id declaration

* Suggested change

* Remove unused self._id
2020-03-23 22:16:17 +01:00
Franck Nijhof 513abcb7e5 Add effect service to WLED integration (#33026)
* Add effect service to WLED integration

* Inline service schema
2020-03-23 13:21:35 -07:00
Paulus Schoutsen 1ff245d9c2 Make sure entity platform services work for all platforms of d… (#33176)
* Make sure entity platform services work for all platforms of domain

* Register a bad service handler

* Fix cleaning up

* Tiny cleanup
2020-03-23 12:59:36 -07:00
J. Nick Koston 2360fd4141 Switch legacy calls to init_recorder_component using async_add… (#33185) 2020-03-23 11:27:45 -07:00
Pascal Vizeli 95de94e53f Update azure-pipelines-wheels.yml for Azure Pipelines 2020-03-23 16:48:44 +00:00
Pascal Vizeli ea23ffedfe Update azure-pipelines-wheels.yml for Azure Pipelines 2020-03-23 17:47:43 +01:00
Alexei Chetroi bf4b099f11 Update sw_version in device registry for ZHA devices (#33184)
* Update firmware version in device registry.
Parse recevied OTA requests for firmware version and update device
registry.

* Update tests.
* Cleanup sw_id_update listener.
* Update ZHA test devices list.
2020-03-23 12:42:41 -04:00
J. Nick Koston b8fdebd05c Add aircleaner and humidify service to nexia climate (#33078)
* Add aircleaner and humidify service to nexia climate

* These were removed from the original merge to reduce review scope

* Additional tests for binary_sensor, sensor, and climate states

* Switch to signals for services

Get rid of everywhere we call device and change to zone or thermostat
as it was too confusing

Renames to make it clear that zone and thermostat are tightly coupled

* Make scene activation responsive

* no need to use update for only one key/value

* stray comma

* use async_call_later

* its async, need ()s

* cleaner

* merge entity platform services testing branch
2020-03-23 11:01:48 -05:00
Pascal Vizeli 181b2803cd Update azure-pipelines-wheels.yml for Azure Pipelines 2020-03-23 15:56:50 +00:00
Pascal Vizeli 0e3dc7976c Update azure-pipelines-wheels.yml for Azure Pipelines 2020-03-23 16:54:06 +01:00
jasperro c8d4cf08d9 Add Tado set presence (#32765)
* Updated tado integration climate.py to allow for presence change

* Updated tado integration __init__.py to allow for presence change

* Black formatting

* Added missing docstring

* Added missing period to docstring

* Using constants from climate component

* Filter out other preset_modes

* Linting error fix

* Isort error fix

* Filtering of unwanted presence mode in init

* Bumped python-tado version to 0.5.0

Removed unnecessary preset mode check

* Update requirements_all.txt
2020-03-23 10:40:15 -05:00
Balazs Keresztury df67ab995f Add support for Bosch BMP280 Sensor (#30837)
* Implement support for Bosch BMP280 Sensor

* Fixed linting errors

* Fixed case of the requirement RPi.GPIO so it is ignored in requirements

* Update homeassistant/components/bmp280/manifest.json

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Update homeassistant/components/bmp280/sensor.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Fix linting errors

* Implemented changes suggested by code review

* Fixed incomplete refactoring

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-03-23 09:12:59 -05:00
Pascal Vizeli e0f2fa33df [skip ci] Update azure-pipelines-wheels.yml for Azure Pipelines 2020-03-23 13:19:14 +00:00
Pascal Vizeli 884c346bdf Fix dockerfile 2020-03-23 13:19:02 +00:00
Pascal Vizeli c218ff5a75 Integrate dockerbuild (#33168)
* Integrate dockerbuild

* cleanup
2020-03-23 13:18:48 +00:00
Pascal Vizeli fa43a218d2 Update azure-pipelines-wheels.yml for Azure Pipelines 2020-03-23 13:18:33 +00:00
Pascal Vizeli f4cc64d289 [skip ci] add rc into build 2020-03-23 13:18:18 +00:00
Pascal Vizeli 4c31829832 [skip ci] update wheels builder version 2020-03-23 13:18:00 +00:00
Pascal Vizeli ff32c1c3e9 Update azure-pipelines-wheels.yml 2020-03-23 13:17:49 +00:00
Pascal Vizeli c21a2eab22 [skip ci] Update azure-pipelines-wheels.yml for Azure Pipelines 2020-03-23 13:14:50 +01:00
Vegetto df2351b920 Support for COLOR_TEMP in Homematic dimmers (#31207)
* Support for COLOR_TEMP in Homematic dimmers

* Fix lint issues

* Added pre-checks

* Fix review feedback

* Remove unneded code
2020-03-23 10:56:44 +01:00
Olivier B 4332cbe112 Add Tesla sentry mode switch (#32938)
* Add Tesla sentry mode switch

* add available property, fix is_on

* bump teslajsonpy to 0.6.0
2020-03-23 10:52:59 +01:00
J. Nick Koston f9a7c64106 Config flow for doorbird (#33165)
* Config flow for doorbird

* Discoverable via zeroconf

* Fix zeroconf test

* add missing return

* Add a test for legacy over ride url (will go away when refactored to cloud hooks)

* Update homeassistant/components/doorbird/__init__.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* without getting the hooks its not so useful

* Update homeassistant/components/doorbird/config_flow.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* fix copy pasta

* remove identifiers since its in connections

* self review fixes

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-03-23 10:14:21 +01:00
Jason Swails 49ebea2be3 Add support for occupancy/vacancy groups in Lutron Caseta component (#33032)
* Add support for Lutron Caseta occupancy/vacancy sensors

This follows updates to pylutron-caseta to add support for these
devices. This code works for me as a custom component in Home Assistant
Core with pylutron-caseta 0.6.0 (currently unreleased).

* black formatting

* Update requirements_all.txt

* Apply black formatting

* Resolve some review comments

* serial -> unique_id

* Black formatting

* Resolve linting errors

* Add code owner...

* Fix isort complaint

* Fix remaining isort complaints

* Update codeowners

* Resolve outstanding review comments

* Remove caseta_
2020-03-23 07:51:24 +01:00
J. Nick Koston b09a9fc81a Add config flow for Nuheat (#32885)
* Modernize nuheat for new climate platform

* Home Assistant state now mirrors the
  state displayed at mynewheat.com

* Remove off mode as the device does not implement
  and setting was not implemented anyways

* Implement missing set_hvac_mode for nuheat

* Now shows as unavailable when offline

* Add a unique id (serial number)

* Fix hvac_mode as it was really implementing hvac_action

* Presets now map to the open api spec
  published at https://api.mynuheat.com/swagger/

* ThermostatModel: scheduleMode

* Revert test cleanup as it leaves files behind.

Its going to be more invasive to modernize the tests so
it will have to come in a new pr

* Config flow for nuheat

* codeowners

* Add an import test as well

* remove debug
2020-03-23 00:29:45 -05:00
J. Nick Koston fa60e9b03b Improve sense timeout exception handling (#33127)
asyncio.Timeout needs to be trapped as well
2020-03-22 21:41:59 -07:00
J. Nick Koston 0b2a8bf79a Make harmony handle IP address changes (#33173)
If the IP address of the harmony hub changed it would
not be rediscovered.  We now connect to get the
unique id and then update config entries with
the correct ip if it is already setup.
2020-03-22 21:24:49 -07:00
Alan Tse 087b672449 Add enable_wake_on_start option to Tesla (#33035) 2020-03-22 22:33:55 -05:00
Pascal Vizeli d3f9408650 Fix dockerfile 2020-03-23 01:00:00 +01:00
Pascal Vizeli 6e6ad94df6 Integrate dockerbuild (#33168)
* Integrate dockerbuild

* cleanup
2020-03-23 00:39:37 +01:00
J. Nick Koston e344c2ea64 Add gate support to myq, fix bouncy updates (#33124)
* Add gate support to myq, fix bouncy updates

Switch to DataUpdateCoordinator, previously
we would hit the myq api every 60 seconds per device.

If you have access to 20 garage doors on the account it means
we would have previously tried to update 20 times per minutes.

* switch to async_call_later
2020-03-22 16:28:55 -07:00
Ivan Dyedov ab8c50895e Add fahrenheit support in miflora sensor (#33136)
* add support for fahrenheit in miflora sensor

* fix error introduced when resolving merge conflict

* fix formatting
2020-03-22 21:58:35 +01:00
Matt Snyder f0472f2dc2 Fix QVR Pro connection error and add port option (#33070)
* Allow port specification.  Handle connection error gracefully.

* Allow port specification.  Handle connection error gracefully.

* Alias exception. Requested changes.
2020-03-22 21:43:45 +01:00
Quentame 0249daef2e Bump iCloud to 0.9.6.1 (#33161) 2020-03-22 21:05:27 +01:00
Eugenio Panadero 8d2e72cdf6 Add pvpc electricity prices integration (#32092)
* Add new integration: pvpc_hourly_pricing

to add a sensor with the current hourly price of electricity in Spain.
Configuration is done by selecting one of the 3 reference tariffs, with
1, 2, or 3 billing periods.

* Features config flow, entity registry, RestoreEntity, options flow
  to change tariff, manual yaml config as integration or sensor platform
* Cloud polling sensor with minimal API calls (3/hour at random times)
  and smart retry; fully async
* Only 1 state change / hour (only when the price changes)
* At evening, try to download published tomorrow prices, to always store
  prices info for a window of [3, 27] hours in the future.
* Include useful state attributes to program automations to be run
  at best electric prices.
* Add spanish and english translations.

* Requires `xmltodict` to parse official xml file with hourly prices
for each day.

* Update requirements and add to codeowners

* Avoid passing in hass as a parameter to the entity

Instead, create time change listeners in async_added_to_hass and
call async_generate_entity_id before async_add_entities

* Fix lint issues

* Add tests for config & options flow

* Add tests for manual yaml config

with entity definition as integration and also as a sensor platform

* Fix placement of PLATFORM_SCHEMA and update generated config_flows

* Store prices internally linked to UTC timestamps

- to deal with days with DST changes
- and work with different local timezones

* Add availability to sensor

to 'expire' the sensor if there is no connection available
 and current hour is not in the stored prices.

Also, turn off logging and retrying if prices can't be downloaded
repeatedly, by flagging `data_source_available` as False, so there is no
log-flood mess.

* Add more tests

- to cover behavior in DST changes and complete coverage of sensor logic
- to cover abort config flow

* fix linter

* Better handling of sensor availability and minor enhancements

- Emmit 1 error if data source is marked as unavailable
  (after some retries), and be silent until cloud access is recovered,
  then emmit 1 warning.
- Follow standard of camel_case keys in attributes

* Mock aiosession to not access real API, store fixture data

- Store a set of daily xml files to test sensor logic for all situations
- Mock time and session to run tests with stored API responses
- Add availability test to simulate a lost + recovery of cloud access,
  checking that logging is reasonable: 1 error to flag the continued
  disconnection + 1 warning in recovery.

* Change API endpoint to retrieve JSON data

and remove xmltodict from reqs.

It seems that this endpoint is more reliable than the XML.

* Adapt tests to new API endpoint

* Translate tariff labels to plain English

and sync the default timeout value for all ways of configuration.

* Relax logging levels to meet silver requirements

- 1 warning when becoming unavailable, another warning when recovered.
- Warnings for unexpected TimeoutError or ClientError
- Move the rest to debug level, leaving info for HA internals

Also reduce number of API calls from 3 to 2 calls/hour.

* Fix requirements

* Mod tests to work with timezone Atlantic/Canary

and fix state attributes for timezones != reference, by using 3 price
prefixes: 'price_last_day_XXh', 'price_next_day_XXh' and 'price_XXh',
all generated with local time (backend timezone)

* Try to fix CI tests

* Externalize pvpc data and simplify sensor.py

* add new `aiopvpc` to requirements
* Remove data parsing and price logic from here
* Replace some constant properties with class variables

* Simplify tests for pvpc_hourly_pricing

* Fix updater for options flow

* Updater always reloads
* `tariff` value comes 1st from entry.options, 2nd from entry.data

* Fix lint

* Bump aiopvpc

* Remove options flow and platform setup

- Remove PLATFORM_SCHEMA and async_setup_platform
- Generate config_entry.unique_id with tariff instead of entity_id, in flow step.
- Remove TariffSelectorConfigFlow
- Adapt tests to maintain full coverage

* Fix docstring on test

and rename SENSOR_SCHEMA to SINGLE_SENSOR_SCHEMA to avoid confusion

* Remove timeout manual config, fix entry.options usage, simplify unique_id

* Simplify tests

- No need for a test_setup now, as platform setup is removed and integration
  setup is already used in `test_availability`
- Simplified `_process_time_step`: only one async_fire(EVENT_TIME_CHANGED)/hour

* Fix possible duplicated update

when source is not available.

* Do not access State last_changed for log messages

* Do not update until entity is added to hass

and call to async_update after 1st download or when recovering access, so
async_write_ha_state is not called twice on those.

* minor changes

* Rename method to select current price and make it a callback
2020-03-22 14:25:31 -05:00
Pascal Vizeli 52ac7285a7 Update azure-pipelines-wheels.yml for Azure Pipelines 2020-03-22 19:40:25 +01:00
Jason Swails 2a3d688923 General code cleanups for lutron_caseta component (#33144)
* General code cleanups for lutron_caseta component

* black

* Update homeassistant/components/lutron_caseta/__init__.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-22 17:35:01 +01:00
Raman Gupta ca3a22b5a3 Filter out duplicate app names from vizio's source list (#33051)
* filter out additional app config names from pyvizios app list

* add test

* change where filtering app list occurs

* fix test

* fix mistake in change

* hopefully final test fix

* fix test scenario that unknowingly broke with test change
2020-03-22 17:34:00 +01:00
Pascal Vizeli 912cda4e6f [skip ci] add rc into build 2020-03-22 16:37:33 +01:00
Austin Mroczek c79b3df73f Handle generic_thermostat state unavailable (#32852)
* fix sensor unavailable error

* fix climate.py
2020-03-22 09:35:58 -05:00
Christian Ferbar 8423d18d8d Add Miflora go_unavailable_timeout (#31156)
* Clear state on exception

Clear state if querying the device fails. The state is then set to unknown, so it can be tracked if a miflora device isn't responding any more.

* Add available()

Signal valid data via available()

* miflora: add timeout to go unavailable

* code cleanup

* miflora: tox cleanup
2020-03-22 14:00:09 +01:00
Maciej Bieniek 9d87c1ab1a Bump gios to 0.0.4 (#33141) 2020-03-22 13:44:57 +01:00
Paulus Schoutsen f95c3e265d Fix script logging with name (#33120) 2020-03-22 13:29:50 +01:00
On Freund 66402b9b38 Monoprice PR followups (#33133) 2020-03-22 13:25:27 +01:00
jjlawren 99877c32b1 Bump pyecobee to 0.2.3 (#33130) 2020-03-22 13:19:26 +01:00
Pascal Vizeli 4510e83150 [skip ci] update wheels builder version 2020-03-22 12:31:14 +01:00
Pascal Vizeli 252d934caa Update azure-pipelines-wheels.yml 2020-03-22 12:17:48 +01:00
On Freund e8bd1b9216 Config Flow and Entity registry support for Monoprice (#30337)
* Entity registry support for monoprice

* Add test for unique_id

* Add unique id namespace to monoprice

* Config Flow for Monoprice

* Update monoprice tests

* Remove TODOs

* Handle entity unloading

* Fix update test

* Streamline entity handling in monoprice services

* Increase coverage

* Remove devices cache

* Async validation in monoprice config flow
2020-03-21 18:12:32 -07:00
guillempages 99d732b974 Revert "Validate UUID for tankerkoenig (#32805)" (#33123)
This reverts commit 49c2a4a4e3.
The validation was causing more problems than it was fixing, so removed
it completely
2020-03-21 17:48:18 -07:00
Paulus Schoutsen 05e7238c45 Merge remote-tracking branch 'origin/master' into dev 2020-03-21 17:25:46 -07:00
Paulus Schoutsen 677c276b41 Merge pull request #33118 from home-assistant/rc
0.107.5
2020-03-21 17:22:31 -07:00
Alexei Chetroi 991afccbd4 Refactor ZHA EventChannels (#32709)
* Refactor EventChannels.

* Rename EventRelayChannel.

* Fully rename EventRelayChannel.

- update docstrings
- rename all references from "relay" to "client"

* Remove CHANNEL_NAME.

* Update stale docstring.
2020-03-21 19:59:32 -04:00
Eugenio Panadero d5e606640c Fix scheduled update time-drift in data update coordinator (#32974)
* Fix scheduled update time-drift in data update coordinator

As next schedule is calculated **after** the update is done,
setting now + update_interval makes 1 second drift in practice,
as the tick is 1Hz.

* Floor the utcnow timestamp

to remove sub-second error precision, and generate constant frequency updates
as long as the update takes < 1s.
2020-03-21 16:57:12 -07:00
Paulus Schoutsen ca1c696f54 Bumped version to 0.107.5 2020-03-21 16:34:11 -07:00
Franck Nijhof 78e5878247 Fix Extend ONVIF unique ID with profile index (#33103) 2020-03-21 16:34:05 -07:00
guillempages 470537bc5f Fix tankerkoenig with more than 10 stations (#33098)
* Fix tankerkoenig with more than 10 stations

There seemed to be a problem, if more than 10 fuel stations were tracked.
Added a warning in this case, and split the calls to the API in chunks of
10, so that the data can be fetched anyway.

* Update homeassistant/components/tankerkoenig/__init__.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-21 16:33:55 -07:00
Austin Mroczek 64556f6f69 Fix totalconnect AttributeError introduced in 0.107 (#33079)
* Fit git

* Remove period from loggging message

* Remove tests for now

* Add const.py

* Fix lint error
2020-03-21 16:32:26 -07:00
Alexei Chetroi 2785b067e3 Split ZHA device loading and entities adding (#33075)
* Split ZHA device loading and entities adding.
Load zha devices from ZHA gateway, but add entities after integration
was setup.

* Use hass.loop.create_task()
* Split ZHA device initialization from loading.
Restore and initialize ZHA devices separately.

* Use hass.async_create_task()
Load devices prior group initialization.
2020-03-21 16:32:26 -07:00
escoand a129bc05ae Try all Samsung TV websocket ports (#33001)
* Update bridge.py

* add test

* silence pylint

* correct pylint

* add some tests

* Update test_media_player.py
2020-03-21 16:32:25 -07:00
Ville Skyttä 197736f66b Upgrade huawei-lte-api to 1.4.11 (#32791)
https://github.com/Salamek/huawei-lte-api/releases/tag/1.4.11
2020-03-21 15:16:33 -07:00
Franck Nijhof 6d4fa76107 Add Wi-Fi sensors to WLED integration (#33055) 2020-03-21 15:14:41 -07:00
Austin Mroczek ba2558790d Fix totalconnect AttributeError introduced in 0.107 (#33079)
* Fit git

* Remove period from loggging message

* Remove tests for now

* Add const.py

* Fix lint error
2020-03-21 15:14:19 -07:00
guillempages 79f6d55fe8 Fix tankerkoenig with more than 10 stations (#33098)
* Fix tankerkoenig with more than 10 stations

There seemed to be a problem, if more than 10 fuel stations were tracked.
Added a warning in this case, and split the calls to the API in chunks of
10, so that the data can be fetched anyway.

* Update homeassistant/components/tankerkoenig/__init__.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-21 15:12:14 -07:00
Aaron Bach 403b4a2e0b Bump simplisafe-python to 9.0.5 (#33116) 2020-03-21 16:01:39 -06:00
Franck Nijhof 8272c71811 Handle query and anchors in Spotify URI's (#33084)
* Handle query and anchors in Spotify URI's

* Use yarl for cleaning up the URL
2020-03-21 12:24:23 -07:00
Anders Melchiorsen 699ca44260 Clean up Sonos attributes for radio streams (#33063) 2020-03-21 12:17:00 -07:00
Franck Nijhof 5893f6b14b Fix Extend ONVIF unique ID with profile index (#33103) 2020-03-21 11:36:35 -07:00
Franck Nijhof a7b08c48f3 Upgrade spotipy to 2.10.0 (#33083) 2020-03-21 19:25:29 +01:00
J. Nick Koston 0148708613 Add DEVICE_CLASS_GATE (#33074)
Gates are found outside of a structure and are typically part of a fence.
2020-03-21 11:17:06 -07:00
Alexei Chetroi 81cef9a281 Split ZHA device loading and entities adding (#33075)
* Split ZHA device loading and entities adding.
Load zha devices from ZHA gateway, but add entities after integration
was setup.

* Use hass.loop.create_task()
* Split ZHA device initialization from loading.
Restore and initialize ZHA devices separately.

* Use hass.async_create_task()
Load devices prior group initialization.
2020-03-21 13:25:43 -04:00
escoand 2bb29485be Try all Samsung TV websocket ports (#33001)
* Update bridge.py

* add test

* silence pylint

* correct pylint

* add some tests

* Update test_media_player.py
2020-03-21 16:50:18 +01:00
Jonas Kohlbrenner 57820be92a Add scan_interval support for NUT integration (#31167)
* Added scan_interval support

* Changed to config[key] for required keys and optional keys with default value

* Removed usage of Throttle
2020-03-21 16:45:10 +01:00
Balazs Sandor e18bea0215 bump version zigpy-cc (#33097) 2020-03-21 10:43:55 -04:00
guillempages 49c2a4a4e3 Validate UUID for tankerkoenig (#32805)
* Validate UUIDs against custom validator

Instead of just validating against strings, use a custom validator,
so that the format can be checked.

* Add tests for custom UUID4 validator
2020-03-21 09:43:12 -05:00
Franck Nijhof ebc4804e04 Don't exempt project for PR's for stalebot (#33086) 2020-03-21 15:29:46 +01:00
Ville Skyttä ffc9bcb4d7 Use PEP 526 syntax with NamedTuples (#33081) 2020-03-21 11:18:32 +02:00
Franck Nijhof d82d7fa2e9 Merge pull request #33080 from home-assistant/rc
0.107.4
2020-03-21 07:51:18 +01:00
Franck Nijhof e87fab6b5f Remove mopar integration (ADR-0004) (#33066) 2020-03-21 07:09:48 +01:00
Paulus Schoutsen 663db747e9 Bumped version to 0.107.4 2020-03-20 23:02:50 -07:00
Paulus Schoutsen 57998f6f0f Fix package default extraction (#33071) 2020-03-20 23:02:29 -07:00
Knapoc edbb995fff Bump aioasuswrt to 1.2.3 and fix asuswrt sensor (#33064)
* Bump aioasuswrt to 1.2.3

* Fix asuswrt connection setup parameters

* fix typo
2020-03-20 23:02:29 -07:00
Aaron Bach 312903025d Bump simplisafe-python to 9.0.4 (#33059) 2020-03-20 23:02:28 -07:00
Paulus Schoutsen 0ae5c325fe Add negative tests for identify schema for packages (#33050) 2020-03-20 23:02:27 -07:00
Paulus Schoutsen b6d9454b54 Fix package default extraction (#33071) 2020-03-20 20:27:37 -07:00
J. Nick Koston 85328399e0 Add support for nexia automations (#33049)
* Add support for nexia automations

Bump nexia to 0.7.1

Start adding tests

Fix some of the climate attributes that were wrong (discovered while adding tests)

Pass the name of the instance so the nexia UI does not display "My Mobile"

* fix mocking

* faster asserts, scene

* scene makes so much more sense

* pylint

* Update homeassistant/components/nexia/scene.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* docstring cleanup

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-20 18:49:42 -05:00
Aaron Bach 836413a4a8 Bump simplisafe-python to 9.0.4 (#33059) 2020-03-20 14:59:01 -06:00
Paulus Schoutsen d16d44d3e7 Add negative tests for identify schema for packages (#33050) 2020-03-20 13:34:56 -07:00
Knapoc c2ac8e813a Bump aioasuswrt to 1.2.3 and fix asuswrt sensor (#33064)
* Bump aioasuswrt to 1.2.3

* Fix asuswrt connection setup parameters

* fix typo
2020-03-20 21:34:17 +01:00
J. Nick Koston 37687561c0 Add config flow for myq (#32890)
* Add a config flow for myq

* Discovered by homekit

* Fix gates being treated as garage doors

* Offline devices now show as unavailable

* Homekit flow

* strip out icon

* return -> raise
2020-03-20 15:28:14 -05:00
Franck Nijhof acf41d03db Remove alarmdotcom integration (ADR-0004) (#33056) 2020-03-20 20:21:20 +01:00
J. Nick Koston 92d373055f Modernize nuheat for new climate platform (#32714)
* Modernize nuheat for new climate platform

* Home Assistant state now mirrors the
  state displayed at mynewheat.com

* Remove off mode as the device does not implement
  and setting was not implemented anyways

* Implement missing set_hvac_mode for nuheat

* Now shows as unavailable when offline

* Add a unique id (serial number)

* Fix hvac_mode as it was really implementing hvac_action

* Presets now map to the open api spec
  published at https://api.mynuheat.com/swagger/

* ThermostatModel: scheduleMode

* Empty commit to re-run ci

* Revert test cleanup as it leaves files behind.

Its going to be more invasive to modernize the tests so
it will have to come in a new pr
2020-03-20 11:01:51 -07:00
Pascal Vizeli a309a00929 Merge pull request #33054 from home-assistant/rc
0.107.3
2020-03-20 18:33:47 +01:00
James Nimmo c00f04221f Add IntesisHome support for air to water heat pumps (#32250)
* Add Intesis support for air to water heat pumps

* Bump to pyIntesisHome 1.7.1

* Fix

* Re-order HVAC modes
2020-03-20 10:17:50 -07:00
GaryOkie 414559f018 Enable incremental Pan/Tilt/Zoom capability to Amcrest/Dahua cameras (#32839)
Add new "amcrest.ptz_control" service to specify a PTZ camera movement or zoom direction (up, down, right, left, right_up, right_down, left_up, left_down, zoom_in, zoom_out). An optional travel_time attribute specifies the amount of movement between start/stop.
2020-03-20 11:34:42 -05:00
Pascal Vizeli 55be5bf880 Bump version to 0.107.3 2020-03-20 16:29:10 +00:00
Franck Nijhof 7b37dcd8ed Fix packages for schemas without a default (#33045) 2020-03-20 16:27:29 +00:00
cgtobi e36bdd717a Fix discovery issue with netatmo climate devices (#33040) 2020-03-20 16:27:28 +00:00
cgtobi fa650b648c Fix netatmo webhook registration issue (#32994)
* Wait for cloud connection

* Just wait

* Remove redundant entry

* Drop webhook before unloading other platforms

* Add missing scope

* Update homeassistant/components/netatmo/__init__.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Fix test

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-03-20 16:27:27 +00:00
Franck Nijhof 661101df08 Fix packages for schemas without a default (#33045) 2020-03-20 08:17:43 -07:00
Steven Rollason ecbcdee934 Bump pyhaversion to 3.3.0 (#33044) 2020-03-20 15:58:23 +01:00
cgtobi eb77b94315 Fix netatmo webhook registration issue (#32994)
* Wait for cloud connection

* Just wait

* Remove redundant entry

* Drop webhook before unloading other platforms

* Add missing scope

* Update homeassistant/components/netatmo/__init__.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Fix test

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-03-20 15:22:27 +01:00
cgtobi 6ab14a3729 Fix discovery issue with netatmo climate devices (#33040) 2020-03-20 15:20:42 +01:00
Jason Swails f81464161a Break dependency on lutron component (#33031)
* Break dependency on lutron component

* Fix isort complaint
2020-03-20 10:42:34 +01:00
Maciej Bieniek 3461f3a1ed Tests improvements to the Brother integration (#32982)
* Add tests for states of the sensors

* Revert async_update method

* Tests improvement

* Fix icon name

* Tests improvement

* Simplify tests

* Test improvement

* Patch the library instead of the coordinator

* Suggested change

* Remove return_value
2020-03-20 10:21:43 +01:00
Paulus Schoutsen ac2310e7f9 Merge pull request #33030 from home-assistant/rc
0.107.2
2020-03-19 22:51:13 -07:00
Phil Bruckner 0ed7bc3b8e Convert amcrest binary sensors from poll to stream (#32818)
* Convert amcrest binary sensors from poll to stream

- Bump amcrest package to 1.6.0.
- For online binary sensor poll camera periodically to test communications in case
  configuration & usage results in no other communication to camera.
- Start a separate thread to call camera's event_stream method since it never returns.
- Convert all received events into signals that cause corresponding sensors to update.
- Use camera's generic event_channels_happened method to update sensors at startup,
  and whenever camera comes back online after being unavailable.

* Changes per review

* Changes per review 2

* Changes per review 3

- Move event stream decoding to amcrest package.
- Change name of event processing threads so global
  counter is no longer required.
- Bump amcrest package to 1.7.0.
2020-03-19 21:07:21 -07:00
Aaron Bach aee5c16803 Fix RainMachine not properly storing data in the config entry (#33002)
* Fix bug related to RainMachine's default config flow

* A

* Fix tests

* Code review
2020-03-19 20:54:57 -07:00
Aaron Bach d8e3e9abaa Fix RainMachine not properly storing data in the config entry (#33002)
* Fix bug related to RainMachine's default config flow

* A

* Fix tests

* Code review
2020-03-19 20:54:41 -07:00
Paulus Schoutsen 5f0816ea25 Fix zones in packages (#33027) 2020-03-19 20:52:08 -07:00
Paulus Schoutsen 6a6037790f Bumped version to 0.107.2 2020-03-19 20:50:46 -07:00
Alexei Chetroi d2b0c35319 Handle zigpy clusters without ep_attribute attribute. (#33028) 2020-03-19 20:50:34 -07:00
Jc2k d707a1b072 0.107.2 - Bump aiohomekit to fix Insignia NS-CH1XGO8 and Lenno… (#33016) 2020-03-19 20:46:45 -07:00
Aaron Bach ca12db9271 Bump simplisafe-python to 9.0.3 (#33013) 2020-03-19 20:45:57 -07:00
Robin 346a4b399d Fix sighthound dependency issue (#33010) 2020-03-19 20:45:56 -07:00
Robert Svensson 2090252936 Axis - Fix char in stream url (#33004)
* An unwanted character had found its way into a stream string, reverting f-string work to remove duplication of code and improve readability

* Fix failing tests
2020-03-19 20:45:56 -07:00
tetienne a28091e94a Fix somfy optimistic mode when missing in conf (#32995)
* Fix optimistic mode when missing in conf #32971

* Ease code using a default value

* Client id and secret are now inclusive
2020-03-19 20:45:55 -07:00
Alexei Chetroi ae8cb0ccdf Refactor ZHA setup (#32959)
* Refactor ZHA setup.
Catch errors and raise if needed.

* Cleanup.
2020-03-19 20:45:54 -07:00
Maikel Punie 06a608e342 Fix velbus in the 107 release (#32936)
velbus 2.0.41 introduced some data files in the python module. They are not copied when installing the velbus module. 2.0.43 fixes this problem
2020-03-19 20:45:53 -07:00
ochlocracy 9af95e8577 Fix camera.options to camera.stream_options. (#32767) 2020-03-19 20:45:53 -07:00
Paulus Schoutsen c3c5cc9ae7 Fix zones in packages (#33027) 2020-03-19 20:45:26 -07:00
J. Nick Koston 5db1a67c20 Make powerwall unique id stable (#33021)
* Update powerwall unique id

* Fix somfy optimistic mode when missing in conf (#32995)

* Fix optimistic mode when missing in conf #32971

* Ease code using a default value

* Client id and secret are now inclusive

* Bump aiohomekit to fix Insignia NS-CH1XGO8 and Lennox S30 (#33014)

* Axis - Fix char in stream url (#33004)

* An unwanted character had found its way into a stream string, reverting f-string work to remove duplication of code and improve readability

* Fix failing tests

* deCONZ - Add support for Senic and Gira Friends of Hue remote… (#33022)

* Update the test

* Harmony config flow improvements (#33018)

* Harmony config flow improvements

* Address followup review comments from #32919

* pylint -- catching my naming error

* remove leftovers from refactor

* Update powerwall unique id

* Update the test

Co-authored-by: tetienne <thibaut@etienne.pw>
Co-authored-by: Jc2k <john.carr@unrouted.co.uk>
Co-authored-by: Robert Svensson <Kane610@users.noreply.github.com>
2020-03-19 20:43:09 -07:00
Alexei Chetroi 1a4199c485 Handle zigpy clusters without ep_attribute attribute. (#33028) 2020-03-19 22:47:08 -04:00
Alexei Chetroi 8cb1d630c8 Poll Hue lights in ZHA (#33017)
* Weighted ZHA entity matching.
* Poll ZHA Hue lights in 5 min intervals.
* Add comment.
* Spelling.
2020-03-19 22:14:07 -04:00
J. Nick Koston f275b7e5ed Add Nexia thermostat support (Trane / American Standard) (#32826)
* Merge nexia

* Restore original work

* Merge cleanups

* config flow

* Add config flow

* Add missing files

* Fix import of old yaml config

* More cleanups from self review

* Additional self review

* Update homeassistant/components/nexia/services.yaml

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* fix io in event loop

* Update homeassistant/components/nexia/climate.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* avoid using ternary statements if they span multiple

* Cleanup strings and remove unneeded attributes

* more cleanup

* more cleanup of yaml

* remove coordinator boiler plate

* nuke services for now for the inital pr, add back later

* remove copy pasta

* this can be reduced more

* Update homeassistant/components/nexia/config_flow.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/nexia/config_flow.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/nexia/__init__.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/nexia/__init__.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/nexia/__init__.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/nexia/__init__.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* review

* comments

* Update homeassistant/components/nexia/climate.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/nexia/climate.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/nexia/climate.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* more review adjustments

* nuke unused constants

* Update homeassistant/components/nexia/config_flow.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* map states

* add update

* zone id is unique

* Fix humidfy check

* target_humidity should be a property instead of in attributes

* remove aux heat as its already there

Co-authored-by: Ryan Nazaretian <ryannazaretian@gmail.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-19 21:03:51 -05:00
J. Nick Koston c9592c1447 Harmony config flow improvements (#33018)
* Harmony config flow improvements

* Address followup review comments from #32919

* pylint -- catching my naming error

* remove leftovers from refactor
2020-03-19 20:43:44 -05:00
Robert Svensson ff2367fffb deCONZ - Add support for Senic and Gira Friends of Hue remote… (#33022) 2020-03-19 16:40:50 -07:00
Robert Svensson 4c9303bbd5 Axis - Fix char in stream url (#33004)
* An unwanted character had found its way into a stream string, reverting f-string work to remove duplication of code and improve readability

* Fix failing tests
2020-03-19 16:30:38 -07:00
Jc2k 84712d2f40 Bump aiohomekit to fix Insignia NS-CH1XGO8 and Lennox S30 (#33014) 2020-03-19 16:25:18 -07:00
tetienne 5a2aabea9c Fix somfy optimistic mode when missing in conf (#32995)
* Fix optimistic mode when missing in conf #32971

* Ease code using a default value

* Client id and secret are now inclusive
2020-03-19 16:09:14 -07:00
Aaron Bach 23045af4a7 Bump simplisafe-python to 9.0.3 (#33013) 2020-03-19 16:39:24 -06:00
Paulus Schoutsen 29a9781bf7 Fix unifi tests 2020-03-19 15:28:38 -07:00
Jc2k 877eddf43d 0.107.2 - Bump aiohomekit to fix Insignia NS-CH1XGO8 and Lenno… (#33016) 2020-03-19 15:26:01 -07:00
Robin 9451920ab5 Fix sighthound dependency issue (#33010) 2020-03-19 20:34:15 +01:00
Balazs Sandor 62f2ee5f60 Bump version of zigpy-cc to 0.2.3 (#32951) 2020-03-19 11:42:49 -05:00
Alexei Chetroi c8c81d493d Refactor ZHA setup (#32959)
* Refactor ZHA setup.
Catch errors and raise if needed.

* Cleanup.
2020-03-19 12:37:47 -04:00
J. Nick Koston d33a3ca90f Config flow for harmony (#32919)
* Config flow for harmony

* Fixes unique ids when using XMPP

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Find the unique id for the config flow

* move shutdown to init

* Add test for ssdp (still failing)

* Fix ssdp test

* Add harmony to MIGRATED_SERVICE_HANDLERS (this is a breaking change)

* more cleanups

* use unique id for the config file

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-03-19 11:29:51 -05:00
J. Nick Koston 5b4d2aed64 Add Powerwalls integration (#32851)
* Create an integration for Powerwalls

* Self review :: remove unused code

* Remove debug

* Update homeassistant/components/powerwall/__init__.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* _call_site_info to module level

* Update homeassistant/components/powerwall/binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update tests/components/powerwall/test_binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* remove sensors that I added tests for from the comment

* Update homeassistant/components/powerwall/config_flow.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Switch to UNIT_PERCENTAGE

* reduce code

* Add test for import

* Adjust tests

* Add missing file

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-19 10:50:17 -05:00
Alexei Chetroi 242aff9269 Fix mypy in ci by removing unneeded ignore in zone init (#32997) 2020-03-19 10:44:52 -05:00
MatthewFlamm 445ef861c0 Add pending to template alarm (#31614) 2020-03-19 02:38:24 -05:00
Maikel Punie 03c906a2f1 Fix velbus in the 107 release (#32936)
velbus 2.0.41 introduced some data files in the python module. They are not copied when installing the velbus module. 2.0.43 fixes this problem
2020-03-19 01:56:32 -05:00
Erik Montnemery e0d2e5dcb0 Remove deprecated features from MQTT platforms (#32909)
* Remove deprecated features

* Lint
2020-03-18 22:39:15 -07:00
Paulus Schoutsen 88e3e73bb4 Merge pull request #32964 from home-assistant/rc
0.107.1
2020-03-18 22:14:25 -07:00
Paulus Schoutsen 3aa1bcbb77 Fix mobile app test 2020-03-18 22:13:49 -07:00
Paulus Schoutsen 5c1dc60505 Fix mobile app test 2020-03-18 22:13:37 -07:00
Paulus Schoutsen f6ce5f2d05 Fix type 2020-03-18 18:20:04 -07:00
Paulus Schoutsen f973b35cef Bumped version to 0.107.1 2020-03-18 18:19:33 -07:00
Paulus Schoutsen 4e08aa8b05 Fix zone config (#32963)
* Fix zone config

* Add zone as dependency again to device tracker

* Fix tests
2020-03-18 18:18:57 -07:00
Paulus Schoutsen 8e917ccf73 Add device automation as frontend dependency (#32962) 2020-03-18 18:17:11 -07:00
Bram Kragten 0b62011626 Updated frontend to 20200318.1 (#32957) 2020-03-18 18:17:11 -07:00
Paulus Schoutsen 08aa4b098c Add device automation as frontend dependency (#32962) 2020-03-18 18:15:23 -07:00
Paulus Schoutsen 5123baba3f Fix zone config (#32963)
* Fix zone config

* Add zone as dependency again to device tracker

* Fix tests
2020-03-18 18:14:25 -07:00
Bram Kragten ede0cfaeb8 Updated frontend to 20200318.1 (#32957) 2020-03-18 17:13:19 -07:00
Jc2k 34e44e7f3a Add support for homekit valve accessories to homekit_controller (#32937) 2020-03-18 21:20:40 +00:00
Miroslav Ždrale 0cb27ff236 Bump pyubee to 0.10 to support more Ubee routers (#32934)
* Bump pyubee to 0.10 to support more Ubee routers

* Update requirements_all.txt
2020-03-18 15:45:23 -05:00
Bendik Brenne cb450dcebd Resolve unexpected exception caused by sinch error_code being a string (#32929) 2020-03-18 15:43:43 -05:00
Daniel Shokouhi 661570dfad Small tweaks (#32946) 2020-03-18 15:19:40 -05:00
Ville Skyttä 05abf37046 Type hint improvements (#32905)
* Complete helpers.entity_component type hints

* Add discovery info type
2020-03-18 19:27:25 +02:00
Jc2k 7c79adad8f Refactor and simplify homekit_controller entity setup (#32927) 2020-03-18 10:12:55 -05:00
Franck Nijhof e0769f9ad4 Merge branch 'master' into dev 2020-03-18 16:05:01 +01:00
Franck Nijhof d520a02b8c Merge pull request #32932 from home-assistant/rc
0.107.0
2020-03-18 15:35:44 +01:00
SukramJ 1e469b39ad Fix flaky tests for HMIPC (#32806) 2020-03-18 14:44:29 +01:00
Franck Nijhof c2f615839d Bumped version to 0.107.0 2020-03-18 13:31:02 +01:00
Bram Kragten 657bf33e32 Updated frontend to 20200318.0 (#32931) 2020-03-18 13:27:21 +01:00
Bram Kragten 7d23a734fc Updated frontend to 20200318.0 (#32931) 2020-03-18 13:02:27 +01:00
Franck Nijhof 4e4fd90455 Upgrade shodan to 1.22.0 (#32928) 2020-03-18 11:55:09 +01:00
Franck Nijhof 4517f0d59a Handle unique WLED device using zeroconf properties (#32897) 2020-03-18 11:10:40 +01:00
Maciej Bieniek c1ceab09e5 Migrate Brother to use DataUpdateCoordinator (#32800)
* Use DataCoordinator to update Brother data

* Simplify error text

* Improve tests

* Rename DEFAULT_SCAN_INTERVAL to SCAN_INTERVAL

* Add entity_registry_enabled_default property

* Add quality_scale to manifest.json file

* Remove misleading coordinator.data.data
2020-03-17 22:21:56 -05:00
Aaron Bach 609263e1bb Add cleanup to OpenUV (#32886)
* Add cleanup to OpenUV

* Linting
2020-03-17 22:03:16 -05:00
shred86 f02c5f66d6 Clean up Abode unused automation events (#32825) 2020-03-17 17:58:05 -07:00
Paulus Schoutsen 0ca87007fd Bumped version to 0.107.0b8 2020-03-17 17:56:18 -07:00
Paulus Schoutsen d0d9d853f2 Fix hassio panel load (#32922)
* Fix loading hassio panel

* Remove blacklist
2020-03-17 17:55:57 -07:00
Hans Oischinger 8348878e7e Introduce safe scan_interval for vicare (#32915) 2020-03-17 17:55:56 -07:00
Paulus Schoutsen b70be5f2f2 Blacklist auto_backup (#32912)
* Blacklist auto_backup

* Mock with a set
2020-03-17 17:55:55 -07:00
Bram Kragten fddb565e4c Fix input text reload (#32911)
* Fix input text reload

* FIx schema instead
2020-03-17 17:55:54 -07:00
Rami Mosleh f3e6820042 Fix setting up options due to config data freeze (#32872) 2020-03-17 17:55:54 -07:00
Paulus Schoutsen 82c8f18bc7 Fix hassio panel load (#32922)
* Fix loading hassio panel

* Remove blacklist
2020-03-17 17:54:57 -07:00
Paulus Schoutsen a9d16d4276 Remove mentioning YAML in Roku config flow (#32920) 2020-03-17 16:57:10 -07:00
Erik Montnemery 505de3dce3 Add attributes and availability to MQTT camera (#32908) 2020-03-17 16:49:50 -07:00
Erik Montnemery 52a4c16980 Improve MQTT light test coverage (#32907) 2020-03-17 18:29:12 -05:00
springstan a2ac335222 Fix device condition for alarm_control_panel (#32916) 2020-03-17 22:15:11 +01:00
Hans Oischinger cd79720a14 Introduce safe scan_interval for vicare (#32915) 2020-03-17 13:19:57 -07:00
Rami Mosleh 576970d1ad Fix setting up options due to config data freeze (#32872) 2020-03-17 21:19:42 +01:00
Chris Talkington 9146f76b01 Apply recommendations from roku code review (#32883)
* avoid patching integration methods

* Update config_flow.py

* apply recommendations from roku code review

* Update config_flow.py
2020-03-17 21:15:41 +01:00
Ville Skyttä e97d21aec0 Run gen_requirements_all and hassfest in pre-commit (#32792)
Use generate mode for easy commit amendment with readily generated
files on failure.
2020-03-17 21:03:43 +01:00
Bram Kragten 097b056324 Fix input text reload (#32911)
* Fix input text reload

* FIx schema instead
2020-03-17 20:42:55 +01:00
Franck Nijhof aece76f6cd Bump wled 0.3.0, reduce calls stability improvements (#32903) 2020-03-17 20:17:59 +01:00
Paulus Schoutsen 7bbffa6e6d Blacklist auto_backup (#32912)
* Blacklist auto_backup

* Mock with a set
2020-03-17 12:14:17 -07:00
Paulus Schoutsen ae98f13181 Bumped version to 0.107.0b7 2020-03-17 10:36:59 -07:00
Paulus Schoutsen ab38e7d98a Bump cast to 4.2.0 (#32906) 2020-03-17 10:35:39 -07:00
brubaked 9797b09d44 Changed Sensor icons to be more emotionally sensitive (#32904)
The existing sensor icons, while descriptive - dead = dead - are perhaps too matter of fact and don't accurately convey the tragedy. I changed emoticon-dead-outline to emoticon-cry-outline, as I think it better conveys the reality of the situation along with the emotions tied to the statistic.
2020-03-17 10:35:39 -07:00
Quentame 4908d4358c Bump iCloud to 0.9.5 (#32901) 2020-03-17 10:35:38 -07:00
Paulus Schoutsen 67d728fc50 Make zone dependency of device tracker an after dep (#32880)
* Make zone dependency of device tracker an after dep

* Fix test
2020-03-17 10:34:34 -07:00
Jason Lachowsky 912409ed0c Corrected minor misspellings (#32857) 2020-03-17 10:32:01 -07:00
Paolo Tuninetto ac8c889b0f Add default port to samsung tv (#32820)
* Default port for websocket tv

* Update config entry

* move bridge creation

* fix indent

* remove loop
2020-03-17 10:32:00 -07:00
Quentame 67a721d39b Fix iCloud init while pending (#32750)
* Fix iCloud init while pending

Continue if device is pending while setup
Create devices and fetch 15s if pending, otherwise determine interval to fetch.

* Add retried_fetch guard
2020-03-17 10:32:00 -07:00
Paulus Schoutsen ff582721dd Bump cast to 4.2.0 (#32906) 2020-03-17 10:30:56 -07:00
brubaked 3910ab6cab Changed Sensor icons to be more emotionally sensitive (#32904)
The existing sensor icons, while descriptive - dead = dead - are perhaps too matter of fact and don't accurately convey the tragedy. I changed emoticon-dead-outline to emoticon-cry-outline, as I think it better conveys the reality of the situation along with the emotions tied to the statistic.
2020-03-17 10:17:18 -07:00
Quentame 5c83367bb0 Fix iCloud init while pending (#32750)
* Fix iCloud init while pending

Continue if device is pending while setup
Create devices and fetch 15s if pending, otherwise determine interval to fetch.

* Add retried_fetch guard
2020-03-17 10:16:58 -07:00
Ville Skyttä 433b89de50 Add Huawei LTE WiFi status binary sensors (#32553) 2020-03-17 19:04:01 +02:00
Quentame 4c32fd12fc Bump iCloud to 0.9.5 (#32901) 2020-03-17 17:46:30 +01:00
Aaron Bach a3e2504470 Add cleanup to SimpliSafe (#32889) 2020-03-17 07:02:30 -04:00
Aaron Bach d98432c328 Add cleanup to Ambient PWS (#32888) 2020-03-17 07:02:05 -04:00
Aaron Bach 1da35e2939 Add cleanup to Notion (#32887)
* Add cleanup to Notion

* Base update method
2020-03-17 07:01:40 -04:00
Aaron Bach 0c49c8578b Remove unnecessary awaits in RainMachine (#32884)
* Remove unnecessary awaits in RainMachine

* Cleanup
2020-03-17 07:00:54 -04:00
Paulus Schoutsen abd1909e2b Make zone dependency of device tracker an after dep (#32880)
* Make zone dependency of device tracker an after dep

* Fix test
2020-03-17 06:59:39 -04:00
Erik Montnemery 86d48c608e Deduplicate MQTT tests (#32874) 2020-03-17 02:09:19 -05:00
Aaron Bach a278cf3db2 Improve IQVIA data/API management based on enabled entities (#32291)
* Improve IQVIA data/API management based on enabled entities

* Code review comments

* Code review

* Cleanup

* Linting

* Code review

* Code review
2020-03-16 23:58:50 -06:00
Kevin Eifinger 2cda7bf1e7 Add Here travel time arrival departure (#29909)
* here_travel_time: Add modes arrival and departure

* convert arrival/departure from datetime to time

* Default departure is set by external lib on None

* Use cv.key_value_schemas
2020-03-16 21:16:49 -07:00
Paolo Tuninetto 7ac014744c Add default port to samsung tv (#32820)
* Default port for websocket tv

* Update config entry

* move bridge creation

* fix indent

* remove loop
2020-03-17 00:37:10 +01:00
springstan 51b9afe3c1 Add device condition for alarm_control_panel (#29063)
* Initial commit

* Restricting conditions by supported_features, drop pending condition

* Added tests for no and minimum amount of conditions

* Address review comments

* Sort impors with isort

* Sort impors with isort v2
2020-03-16 18:08:06 -05:00
Paulus Schoutsen d196fd136d Bumped version to 0.107.0b6 2020-03-16 14:53:13 -07:00
Bram Kragten 4f78674a4c Updated frontend to 20200316.1 (#32878) 2020-03-16 14:53:05 -07:00
Bram Kragten a7aca10668 Lovelace: storage key based on id instead of url_path (#32873)
* Fix storage key based on url_path

* Fix test
2020-03-16 14:53:04 -07:00
Paulus Schoutsen 03b1c6ddee Remove group as a dependency from entity integrations (#32870)
* remove group dependency

* Update device sun light trigger

* Add zone dep back to device tracker
2020-03-16 14:53:03 -07:00
David F. Mulcahey 661f1b69f2 Bump ZHA quirks to 0.0.37 (#32867) 2020-03-16 14:53:03 -07:00
Bram Kragten ccb34083fe Add lovelace reload service for yaml resources (#32865)
* Lovelace add reload service for yaml resources

* Clean up imports

* Comments
2020-03-16 14:53:02 -07:00
Paulus Schoutsen 397238372e Remove group as a dependency from entity integrations (#32870)
* remove group dependency

* Update device sun light trigger

* Add zone dep back to device tracker
2020-03-16 14:47:44 -07:00
Bram Kragten 682fcec99e Updated frontend to 20200316.1 (#32878) 2020-03-16 14:27:20 -07:00
David F. Mulcahey 41cd3ba532 Bump ZHA quirks to 0.0.37 (#32867) 2020-03-16 15:29:14 -04:00
Bram Kragten 426f546c2f Add lovelace reload service for yaml resources (#32865)
* Lovelace add reload service for yaml resources

* Clean up imports

* Comments
2020-03-16 20:25:23 +01:00
Bram Kragten 2f1824774f Lovelace: storage key based on id instead of url_path (#32873)
* Fix storage key based on url_path

* Fix test
2020-03-16 20:08:00 +01:00
Paulus Schoutsen 999c5443c1 Fix abode test (#32871) 2020-03-16 10:03:44 -07:00
Knapoc 7ec7306ea8 Update deconz/cover.py to adapt rest-api changes (#32351)
* Update cover.py to adapt rest-api changes

* adjust test to reflect max brightness changes

* implement test for rest-api cover position of 255
2020-03-16 15:44:59 +01:00
shred86 8d68f34650 Add window class for Abode binary sensors (#32854)
* Add window class for binary sensor
2020-03-16 15:03:42 +01:00
sbilly c1908d16b5 Add 'Yeelight LED Ceiling Light' model (#31615)
* Add 'Yeelight LED Ceiling Light' model

Add new model https://www.yeelight.com/en_US/product/luna

* Update requirements_all.txt bump to yeelight 0.5.1

Update requirements_all.txt bump to yeelight 0.5.1

* Update manifest.json, bump to 0.5.1

Update manifest.json, bump to 0.5.1
2020-03-16 14:21:27 +01:00
AJ Schmidt 40356b4fc5 Enable AlarmDecoder arming without security code (#32390)
* set alarmdecoder code_arm_required to False

* rm unnecessary f strings

* add code_arm_required config option

* add self as codeowner :-)

* add self as codeowner the right way
2020-03-16 14:11:08 +01:00
Bram Kragten f4b3760a1a Updated frontend to 20200316.0 (#32866) 2020-03-16 13:30:59 +01:00
Robert Svensson fa63dc1e25 UniFi - Improve expected SSID filter behavior (#32785)
* Improve expected ssid filter behavior

* Fix tests
2020-03-16 12:10:45 +01:00
Maciej Bieniek b9ad40ed38 Bump brother to 0.1.9 (#32861) 2020-03-16 12:00:39 +01:00
Jason Lachowsky 77b3f31e9b Corrected minor misspellings (#32857) 2020-03-16 11:58:12 +01:00
Pascal Vizeli 451c6c25cd Update pyozw 0.1.9 (#32864) 2020-03-16 11:40:21 +01:00
Kris Bennett af021b1c81 Add additional information to SynologySRM device tracker (#32669)
* Updating SynologySRM device trakcers to show additional information

* Fixes

* Aliasing attributes to snake case

* Sugguested changes as per MartinHjelmare
2020-03-16 11:09:48 +01:00
MatthewFlamm 4e3b079a29 Add imperial units to met weather (#32824)
* add feet to meter conversion

* convert pressure and wind. fix wind for metric.

* dont convert wind speed in metric.

pymetno already converts it.

* add units to setup_platform constuctor
2020-03-16 11:04:47 +01:00
David Bonnes 9a099bdf0a Ensure unique_ids for all evohome thermostats (#32604)
* initial commit

* small tweak
2020-03-16 11:04:12 +01:00
Chris Talkington cf8dfdae47 Add config flow to roku (#31988)
* create a dedicated const.py

* add DEFAULT_PORT to const.py

* work on config flow conversion.

* remove discovery.

* work on config flow and add tests. other cleanup.

* work on config flow and add tests. other cleanup.

* add quality scale to manifest.

* work on config flow and add tests. other cleanup.

* review tweaks.

* Update manifest.json

* catch more specific errors

* catch more errors.

* impprt specific exceptions

* import specific exceptions

* Update __init__.py

* Update config_flow.py

* Update media_player.py

* Update remote.py

* Update media_player.py

* Update remote.py

* Update media_player.py

* Update remote.py

* Update config_flow.py

* Update config_flow.py

* Update media_player.py

* Update __init__.py

* Update __init__.py

* Update config_flow.py

* Update test_config_flow.py

* Update config_flow.py

* Update __init__.py

* Update test_config_flow.py

* Update remote.py

* Update test_init.py

* Update test_init.py

* Update media_player.py

* Update media_player.py

* Update media_player.py
2020-03-15 21:13:04 -07:00
Alan Tse 6e95b90f42 Bump teslajsonpy to 0.5.1 (#32827) 2020-03-15 20:42:07 -07:00
shred86 d36259f067 Add Abode tests (#32562)
* Add tests for several devices

* Update coveragerc

* Code review changes and minor clean up

* More code review changes

* Update manifest and minor test updates

* Add test for locks and covers

* Add tests for switch on and off

* Add more complete test for alarms

* Fix for camera test

* Patch abodepy.mode for tests

* Add test for unknown alarm state and minor cleanup

* Update to make tests more robust

* More specific tests

* Update quality scale to silver

* Remove integration quality scale
2020-03-16 03:05:10 +01:00
J. Nick Koston d62bb9ed47 Add model to rachio device info (#32814)
* Add model to rachio device info

Address followup items

* Address review items, retest zone updates back and forth, and standby mode

* Remove super

* Revert "Remove super"

This reverts commit 02e2f156a9.

* Update homeassistant/components/rachio/switch.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/rachio/binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-16 03:01:41 +01:00
Kit Klein ef54f33af7 Ignore the ignored konnected config entries (#32845)
* ignore the ignored konnected config entries

* key off data instead of source
2020-03-16 01:11:26 +01:00
Tom Harris 1391f90a30 Bump insteonplm to 0.16.8 (#32847) 2020-03-15 13:50:23 -07:00
Paulus Schoutsen 2889067ece Make sure panel_custom won't crash on invalid data (#32835)
* Make sure panel_custom won't crash on invalid data

* Add a test
2020-03-15 11:51:02 -07:00
Bram Kragten f4bf66aecd Require a hyphen in lovelace dashboard url (#32816)
* Require a hyphen in lovelace dashboard url

* Keep storage dashboards working

* register during startup again

* Update homeassistant/components/lovelace/dashboard.py

Co-Authored-By: Paulus Schoutsen <balloob@gmail.com>

* Comments

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-03-15 11:50:23 -07:00
SukramJ 2f80489428 Add SF transition to HmIP-BSL and remove obsolete code in HMIPC (#32833) 2020-03-15 19:01:50 +01:00
Steven Looman b6e69cd370 Add log message on timeout and update less often for upnp devices (#32740)
* Catch asyncio.TimeoutError, show a proper message instead

* Throttle updates to max once per 30s

* Change code owner

* Fix CODEOWNERS + linting

* Warn on connection timeout
2020-03-15 18:18:15 +01:00
Daniel Høyer Iversen f9634f0232 Add Netatmo Home Coach as model (#32829) 2020-03-15 12:41:19 +01:00
Jc2k 6affb27711 Fix homekit_controller beta connectivity issues (#32810) 2020-03-14 23:34:29 +01:00
Dave Pearce 5ec76af875 Add Insteon Dual Band SwitchLinc model 2477S to ISY994 (#32813) 2020-03-14 22:56:02 +01:00
Greg 5b41680506 Bump eagle_reader API version to v0.2.4 (#32789) 2020-03-14 22:27:28 +01:00
SukramJ 4f81109304 Fix flaky tests for HMIPC (#32806) 2020-03-14 19:35:15 +01:00
Chris Talkington 04763c5bfb Remove extra logging from directv init. (#32809) 2020-03-14 19:32:38 +01:00
Chris Talkington e5e38edcb2 Fix directv location of unknown error string (#32807)
* Update strings.json

* Update en.json
2020-03-14 19:12:01 +01:00
Ville Skyttä e86919a997 Type hint improvements (#32793) 2020-03-14 11:39:28 +01:00
Ville Skyttä d04479044c Upgrade huawei-lte-api to 1.4.11 (#32791)
https://github.com/Salamek/huawei-lte-api/releases/tag/1.4.11
2020-03-14 11:37:44 +01:00
J. Nick Koston 7737387efe Add config flow for rachio (#32757)
* Do not fail when a user has a controller with shared access on their account

* Add config flow for rachio

Also discoverable via homekit

* Update homeassistant/components/rachio/switch.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Split setting the default run time to an options flow

Ensue the run time coming from yaml gets imported into the option flow

Only get the schedule once at setup instead of each zone (was hitting rate limits)

Add the config entry id to the end of the webhook so there is a unique hook per config entry

Breakout the slew of exceptions rachiopy can throw into RachioAPIExceptions

Remove the base url override as an option for the config flow

Switch identifer for device_info to serial number

Add connections to device_info (mac address)

* rename to make pylint happy

* Fix import of custom_url

* claim rachio

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-03-13 22:46:17 -07:00
Franck Nijhof 743166d284 Fix brightness_pct in light device turn_on action (#32787) 2020-03-13 21:58:32 -07:00
Chris Talkington 5dd031af17 Optimize directv client initialization (#32706)
* Optimize directv client initialization.

* Update config_flow.py

* Update media_player.py

* Update media_player.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update test_media_player.py

* Update __init__.py

* Update media_player.py

* Update test_media_player.py

* Update media_player.py

* Update test_media_player.py

* Update config_flow.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update __init__.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update test_media_player.py

* Update test_media_player.py

* Update __init__.py

* Update __init__.py

* Update __init__.py
2020-03-13 21:55:21 -07:00
J. Nick Koston 750ed2facd Optimize is_entity_exposed in emulated_hue by removing deprec… (#32718)
* emulated_hue: Optimize is_entity_exposed

Switch all list transversals in is_entity_exposed to
hash lookups

get_deprecated is now only called if explict_expose is
set

This funciton was iterating multiple lists per enitity
every time there was an update.  It was responsible for
a chunk of execution time when there are large number
of entities in home assistant.

* Complete deprecation of ATTR_EMULATED_HUE attribute

* Complete deprecation of ATTR_EMULATED_HUE attribute (remove const)

* Remove ATTR_EMULATED_HUE_HIDDEN and Rewrite tests
2020-03-13 21:47:47 -07:00
David F. Mulcahey aa972b0005 Fix handling of attribute reports in ZHA sensors and binary sensors (#32776)
* Update sensor tests.

* Update light tests.

* Update binary_sensor tests.

* Update cover tests.

* Update device tracker tests.

* Update fan tests.

* Update lock tests.

* Update switch tests.

* add sensor attr to sensors

* add sensor attr to binary sensors

* cleanup extra var

Co-authored-by: Alexei Chetroi <alexei.chetroi@outlook.com>
2020-03-13 19:17:50 -04:00
Aidan Timson 628f77f8f2 Fix onvif error with non ptz cameras (#32783) 2020-03-13 23:58:14 +01:00
Slava 9db3900cff Add brightness state to emulated hue when devices support only color temp and brightness (#31834) 2020-03-13 23:42:47 +01:00
J. Nick Koston fd5895118e Do not fail when a user has a controller with shared access on… (#32756) 2020-03-13 14:38:14 -07:00
Andre Lengwenus 607cdfdd32 Bump pypck to 0.6.4 (#32775) 2020-03-13 22:27:53 +01:00
Bram Kragten 460857a765 Updated frontend to 20200313.0 (#32777) 2020-03-13 13:43:39 -07:00
Bram Kragten 6bd55011a8 Check if panel url used and delay dashboard reg till start (#32771)
* Check if panel url used and delay dashboard reg till start

* move storage_dashboard_changed

* fix tests
2020-03-13 11:55:53 -07:00
J. Nick Koston e2a113a2de Bump py-august to 0.25.0 (#32769)
Fixes a bug in the conversion to async where code validation failed.
2020-03-13 18:07:53 +01:00
ochlocracy 86f61b8e55 Fix camera.options to camera.stream_options. (#32767) 2020-03-13 11:50:16 -04:00
smega f3fed5647e Extend rtorrent sensor functionality (#32353)
* Extend rtorrent sensor functionality.

* Remove blank line from end of file.

* After using black formatter.

* Update sensor.py using snake_case for variable names.

* Update PR by using true value in condition.
2020-03-13 15:29:49 +01:00
Franck Nijhof 992daa4a44 Migrate WLED to use DataUpdateCoordinator (#32565)
* Migrate WLED to use DataUpdateCoordinator

* Remove stale debug statement

* Process review suggestions

* Improve tests

* Improve tests
2020-03-13 13:19:05 +01:00
Raman Gupta 26d7b2164e Move apps configuration to options flow for vizio integration (#32543)
* move apps configuration to options flow

* add additional assertion to new test

* add additional assertions for options update

* update docstrings, config validation, and tests based on review
2020-03-13 12:16:24 +01:00
brefra 31d150794d Add memo text service (#31222)
* Add set_memo_text service

* Apply template rendering for memo text

* Update constants to comply to naming conventions

* Local variable for module address and extended error description

* fixed typo
2020-03-13 08:09:30 +01:00
Austin Mroczek 7e6e36db15 Bump total-connect-client to 0.54.1 #32758) 2020-03-13 07:34:09 +01:00
Aaron Bach 4f0997f6e9 Add options flow for SimpliSafe (#32631)
* Fix bug where SimpliSafe ignored code from UI

* Fix tests

* Add options flow

* Fix tests

* Code review

* Code review

* Code review
2020-03-12 22:00:00 -07:00
Eugenio Panadero 94b6ab2862 Use platform tag to register components on hue SensorManager (#32732)
* Use platform tag to register components on hue SensorManager

instead of a boolean flag to decide between sensor and binary sensor,
so it could be used externally (or to get ready for inclusion of other comps)

* Make new item discovery platform agnostic for SensorManager
2020-03-12 18:31:39 -07:00
Franck Nijhof 11a25157c1 Upgrade sqlalchemy to 1.3.15 (#32747) 2020-03-13 00:28:26 +01:00
Franck Nijhof ff92a8b260 Add update class method to DataUpdateCoordinator (#32724)
* Add update class method to DataUpdateCoordinator

* Update homeassistant/helpers/update_coordinator.py

Co-Authored-By: Paulus Schoutsen <balloob@gmail.com>

* Move update_method param

* Rename async_update_data to _async_update_data

* Raise NotImplementedError

* Re-raise NotImplementedError

* Remove caplog, not needed anymore

* Don't set last_update_success on NotImplementedError

* Fix test

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-03-13 00:27:19 +01:00
Paulus Schoutsen 1fe26c77e0 Sonos idle (#32712)
* Sonos idle

* F-string

* Add to properties

* Fixes
2020-03-12 14:47:57 -07:00
Franck Nijhof 00d5e5cfb2 Upgrade pre-commit to 2.2.0 (#32737) 2020-03-12 14:44:14 -07:00
Emilv2 c968e455a9 Fix delijn sensor stuck on last passage (#32710)
* Fix delijn sensor stuck on last passage

If the returned passage is an empty list that means there are
no next passages, so the sensor should be updated accordingly

* Mark the sensor as unavailable instead of emptying data

* use available property

* add available property
2020-03-12 14:43:52 -07:00
Bram Kragten a3dd9979d2 Updated frontend to 20200312.0 (#32741) 2020-03-12 14:41:04 -07:00
Raman Gupta 6e97975ff8 Set self._current_app to None when vizio device is off (#32725) 2020-03-12 15:04:34 +01:00
Franck Nijhof af7c01f957 Bumped version to 0.108.0dev0 (#32697) 2020-03-12 12:40:31 +01:00
Fabian Affolter 29533d8d4d Upgrade sendgrid to 6.1.3 (#32721) 2020-03-12 12:06:01 +01:00
Robert Svensson 374a8157e7 Remove manual configuration support (#32699) 2020-03-12 11:56:50 +01:00
Fabian Affolter 40fc72aac2 Upgrade psutil to 5.7.0 (#32720) 2020-03-12 11:56:07 +01:00
Franck Nijhof b8fab33e69 Remove deprecated hide_if_away from device trackers (#32705) 2020-03-12 11:55:18 +01:00
Ville Skyttä 221d5205e4 Upgrade mypy to 0.770, tighten config a bit (#32715)
* Upgrade mypy to 0.770, related cleanups

https://mypy-lang.blogspot.com/2020/03/mypy-0770-released.html

* Clean up config and make it a notch stricter, address findings
2020-03-12 11:52:20 +01:00
Raman Gupta 77ebda0c20 Update Vizio source property to only return current app if i… (#32713)
* only return current app for source if current app is set

* check for None specifically

* make sure current app isn't called for speaker
2020-03-12 11:01:05 +01:00
J. Nick Koston ac30e5799c Resolve Home Assistant fails to start when Sense integration i… (#32716)
* Bump sense_energy 0.7.1 which also fixes throwing ConfigEntryNotReady
2020-03-12 10:31:55 +01:00
escoand f9a0b4b3cf Fix legacy Samsung TV (#32719)
* Update bridge.py

* Update test_init.py
2020-03-12 10:29:11 +01:00
Barry Williams 233568ac29 If device has volume disabled, the volume will be None. However in these (#32702)
instances whenever the volume was requested a division calculation was made
resulting in a TypeError. The volume adjustment from `0-100` to `0-1` is now
calculated during the `update()` method.
2020-03-12 09:54:25 +01:00
Aaron Bach 76b0302c7f Broaden exception handling for IQVIA (#32708) 2020-03-11 19:34:54 -06:00
Erik Montnemery 8bc542776b Cleanup entity and device registry on MQTT discovery removal (#32693)
* Cleanup entity and device registry on MQTT discovery removal.

* Review comments
2020-03-11 18:00:47 -07:00
Phil Bruckner 5f5cb8bea8 Add support for simultaneous runs of Script helper - Part 2 (#32442)
* Add limit parameter to service call methods

* Break out prep part of async_call_from_config for use elsewhere

* Minor cleanup

* Fix improper use of asyncio.wait

* Fix state update

Call change listener immediately if its a callback

* Fix exception handling and logging

* Merge Script helper if_running/run_mode parameters into script_mode

- Remove background/blocking _ScriptRun subclasses which are no longer needed.

* Add queued script mode

* Disable timeout when making fully blocking script call

* Don't call change listener when restarting script

This makes restart mode behavior consistent with parallel & queue modes.

* Changes per review

- Call all script services (except script.turn_off) with no time limit.
- Fix handling of lock in _QueuedScriptRun and add comments to make it
  clearer how this code works.

* Changes per review 2

- Move cancel shielding "up" from _ScriptRun.async_run to Script.async_run
  (and apply to new style scripts only.) This makes sure Script class also
  properly handles cancellation which it wasn't doing before.
- In _ScriptRun._async_call_service_step, instead of using script.turn_off
  service, just cancel service call and let it handle the cancellation
  accordingly.

* Fix bugs

- Add missing call to change listener in Script.async_run
  in cancelled path.
- Cancel service task if ServiceRegistry.async_call cancelled.

* Revert last changes to ServiceRegistry.async_call

* Minor Script helper fixes & test improvements

- Don't log asyncio.CancelledError exceptions.
- Make change_listener a public attribute.
- Test overhaul
  - Parametrize tests.
  - Use common test functions.
  - Mock timeout so tests don't need to wait for real time to elapse.
  - Add common function for waiting for script action step.
2020-03-11 16:34:50 -07:00
Fabian Affolter da761fdd39 Upgrade pylast to 3.2.1 (#32700) 2020-03-11 23:06:35 +01:00
Fabian Affolter 22415ce49a Upgrade slacker to 0.14.0 (#32698) 2020-03-11 22:41:30 +01:00
Quentame 19be4a5d6d Refactor Freebox : add config flow + temperature sensor + signal dispatch (#30334)
* Add config flow to Freebox

* Add manufacturer in device_tracker info

* Add device_info to sensor + switch

* Add device_info: connections

* Add config_flow test + update .coveragerc

* Typing

* Add device_type icon

* Remove one error log

* Fix pylint

* Add myself as CODEOWNER

* Handle sync in one place

* Separate the Freebox[Router/Device/Sensor] from __init__.py

* Add link step to config flow

* Make temperature sensors auto-discovered

* Use device activity instead of reachablility for device_tracker

* Store token file in .storage

Depending on host if list of Freebox integration on the future without breaking change

* Remove IP sensors + add Freebox router as a device with attrs : IPs, conection type, uptime, version & serial

* Add sensor should_poll=False

* Test typing

* Handle devices with no name

* None is the default for data

* Fix comment

* Use config_entry.unique_id

* Add async_unload_entry with asyncio

* Add and use bunch of data size and rate related constants (#31781)

* Review

* Remove useless "already_configured" error string

* Review : merge 2 device & 2 sensor classes

* Entities from platforms

* Fix unload + add device after setup + clean loggers

* async_add_entities True

* Review

* Use pathlib + refactor get_api

* device_tracker set + tests with CoroutineMock()

* Removing active & reachable from tracker attrs

* Review

* Fix pipeline

* typing

* typing

* typing

* Raise ConfigEntryNotReady when HttpRequestError at setup

* Review

* Multiple Freebox s

* Review: store sensors in router

* Freebox: a sensor story
2020-03-11 22:15:59 +01:00
1299 changed files with 54941 additions and 13663 deletions
+12 -17
View File
@@ -8,15 +8,6 @@ omit =
homeassistant/scripts/*.py
# omit pieces of code that rely on external devices being present
homeassistant/components/abode/__init__.py
homeassistant/components/abode/alarm_control_panel.py
homeassistant/components/abode/binary_sensor.py
homeassistant/components/abode/camera.py
homeassistant/components/abode/cover.py
homeassistant/components/abode/light.py
homeassistant/components/abode/lock.py
homeassistant/components/abode/sensor.py
homeassistant/components/abode/switch.py
homeassistant/components/acer_projector/switch.py
homeassistant/components/actiontec/device_tracker.py
homeassistant/components/adguard/__init__.py
@@ -33,7 +24,6 @@ omit =
homeassistant/components/airvisual/sensor.py
homeassistant/components/aladdin_connect/cover.py
homeassistant/components/alarmdecoder/*
homeassistant/components/alarmdotcom/alarm_control_panel.py
homeassistant/components/alpha_vantage/sensor.py
homeassistant/components/amazon_polly/tts.py
homeassistant/components/ambiclimate/climate.py
@@ -85,6 +75,7 @@ omit =
homeassistant/components/bluetooth_tracker/*
homeassistant/components/bme280/sensor.py
homeassistant/components/bme680/sensor.py
homeassistant/components/bmp280/sensor.py
homeassistant/components/bmw_connected_drive/*
homeassistant/components/bom/camera.py
homeassistant/components/bom/sensor.py
@@ -93,9 +84,6 @@ omit =
homeassistant/components/broadlink/remote.py
homeassistant/components/broadlink/sensor.py
homeassistant/components/broadlink/switch.py
homeassistant/components/brother/__init__.py
homeassistant/components/brother/sensor.py
homeassistant/components/brother/const.py
homeassistant/components/brottsplatskartan/sensor.py
homeassistant/components/browser/*
homeassistant/components/brunt/cover.py
@@ -242,7 +230,11 @@ omit =
homeassistant/components/foscam/const.py
homeassistant/components/foursquare/*
homeassistant/components/free_mobile/notify.py
homeassistant/components/freebox/*
homeassistant/components/freebox/__init__.py
homeassistant/components/freebox/device_tracker.py
homeassistant/components/freebox/router.py
homeassistant/components/freebox/sensor.py
homeassistant/components/freebox/switch.py
homeassistant/components/fritz/device_tracker.py
homeassistant/components/fritzbox/*
homeassistant/components/fritzbox_callmonitor/sensor.py
@@ -433,6 +425,7 @@ omit =
homeassistant/components/minecraft_server/__init__.py
homeassistant/components/minecraft_server/binary_sensor.py
homeassistant/components/minecraft_server/const.py
homeassistant/components/minecraft_server/helpers.py
homeassistant/components/minecraft_server/sensor.py
homeassistant/components/minio/*
homeassistant/components/mitemp_bt/sensor.py
@@ -441,7 +434,6 @@ omit =
homeassistant/components/mochad/*
homeassistant/components/modbus/*
homeassistant/components/modem_callerid/sensor.py
homeassistant/components/mopar/*
homeassistant/components/mpchc/media_player.py
homeassistant/components/mpd/media_player.py
homeassistant/components/mqtt_room/sensor.py
@@ -450,7 +442,6 @@ omit =
homeassistant/components/mychevy/*
homeassistant/components/mycroft/*
homeassistant/components/mycroft/notify.py
homeassistant/components/myq/cover.py
homeassistant/components/mysensors/*
homeassistant/components/mystrom/binary_sensor.py
homeassistant/components/mystrom/light.py
@@ -476,6 +467,7 @@ omit =
homeassistant/components/netgear_lte/*
homeassistant/components/netio/switch.py
homeassistant/components/neurio_energy/sensor.py
homeassistant/components/nextcloud/*
homeassistant/components/nfandroidtv/notify.py
homeassistant/components/niko_home_control/light.py
homeassistant/components/nilu/air_quality.py
@@ -597,7 +589,9 @@ omit =
homeassistant/components/ring/camera.py
homeassistant/components/ripple/sensor.py
homeassistant/components/rocketchat/notify.py
homeassistant/components/roku/*
homeassistant/components/roku/__init__.py
homeassistant/components/roku/media_player.py
homeassistant/components/roku/remote.py
homeassistant/components/roomba/vacuum.py
homeassistant/components/route53/*
homeassistant/components/rova/sensor.py
@@ -614,6 +608,7 @@ omit =
homeassistant/components/saj/sensor.py
homeassistant/components/salt/device_tracker.py
homeassistant/components/satel_integra/*
homeassistant/components/schluter/*
homeassistant/components/scrape/sensor.py
homeassistant/components/scsgate/*
homeassistant/components/scsgate/cover.py
+6
View File
@@ -2,9 +2,15 @@
.git
.github
config
docs
# Development
.devcontainer
.vscode
# Test related files
.tox
tests
# Other virtualization methods
venv
+49
View File
@@ -0,0 +1,49 @@
<!-- READ THIS FIRST:
- If you need additional help with this template, please refer to https://www.home-assistant.io/help/reporting_issues/
- Make sure you are running the latest version of Home Assistant before reporting an issue: https://github.com/home-assistant/core/releases
- Do not report issues for integrations if you are using custom components or integrations.
- Provide as many details as possible. Paste logs, configuration samples and code into the backticks.
DO NOT DELETE ANY TEXT from this template! Otherwise, your issue may be closed without comment.
-->
## The problem
<!--
Describe the issue you are experiencing here to communicate to the
maintainers. Tell us what you were trying to do and what happened.
-->
## Environment
<!--
Provide details about the versions you are using, which helps us to reproduce
and find the issue quicker. Version information is found in the
Home Assistant frontend: Developer tools -> Info.
-->
- Home Assistant Core release with the issue:
- Last working Home Assistant Core release (if known):
- Operating environment (Home Assistant/Supervised/Docker/venv):
- Integration causing this issue:
- Link to integration documentation on our website:
## Problem-relevant `configuration.yaml`
<!--
An example configuration that caused the problem for you. Fill this out even
if it seems unimportant to you. Please be sure to remove personal information
like passwords, private URLs and other credentials.
-->
```yaml
```
## Traceback/Error logs
<!--
If you come across any trace or error logs, please provide them.
-->
```txt
```
## Additional information
+7 -7
View File
@@ -1,10 +1,10 @@
---
name: Report a bug with Home Assistant
about: Report an issue with Home Assistant
name: Report a bug with Home Assistant Core
about: Report an issue with Home Assistant Core
---
<!-- READ THIS FIRST:
- If you need additional help with this template, please refer to https://www.home-assistant.io/help/reporting_issues/
- Make sure you are running the latest version of Home Assistant before reporting an issue: https://github.com/home-assistant/home-assistant/releases
- Make sure you are running the latest version of Home Assistant before reporting an issue: https://github.com/home-assistant/core/releases
- Do not report issues for integrations if you are using custom components or integrations.
- Provide as many details as possible. Paste logs, configuration samples and code into the backticks.
DO NOT DELETE ANY TEXT from this template! Otherwise, your issue may be closed without comment.
@@ -12,7 +12,7 @@ about: Report an issue with Home Assistant
## The problem
<!--
Describe the issue you are experiencing here to communicate to the
maintainers. Tell us what you were trying to do and what happened instead.
maintainers. Tell us what you were trying to do and what happened.
-->
@@ -23,9 +23,9 @@ about: Report an issue with Home Assistant
Home Assistant frontend: Developer tools -> Info.
-->
- Home Assistant release with the issue:
- Last working Home Assistant release (if known):
- Operating environment (Hass.io/Docker/Windows/etc.):
- Home Assistant Core release with the issue:
- Last working Home Assistant Core release (if known):
- Operating environment (Home Assistant/Supervised/Docker/venv):
- Integration causing this issue:
- Link to integration documentation on our website:
+1
View File
@@ -57,6 +57,7 @@ limitPerRun: 30
# Handle pull requests a little bit faster and with an adjusted comment.
pulls:
daysUntilStale: 30
exemptProjects: false
markComment: >
There hasn't been any activity on this pull request recently. This pull
request has been automatically marked as stale because of that and will
+14
View File
@@ -59,3 +59,17 @@ repos:
types: [python]
require_serial: true
files: ^homeassistant/.+\.py$
- id: gen_requirements_all
name: gen_requirements_all
entry: script/run-in-env.sh python3 -m script.gen_requirements_all
pass_filenames: false
language: script
types: [json]
files: ^homeassistant/.+/manifest\.json$
- id: hassfest
name: hassfest
entry: script/run-in-env.sh python3 -m script.hassfest
pass_filenames: false
language: script
types: [json]
files: ^homeassistant/.+/manifest\.json$
+22 -5
View File
@@ -17,6 +17,7 @@ homeassistant/components/abode/* @shred86
homeassistant/components/adguard/* @frenck
homeassistant/components/airly/* @bieniu
homeassistant/components/airvisual/* @bachya
homeassistant/components/alarmdecoder/* @ajschmidt8
homeassistant/components/alexa/* @home-assistant/cloud @ochlocracy
homeassistant/components/almond/* @gcampax @balloob
homeassistant/components/alpha_vantage/* @fabaff
@@ -51,6 +52,7 @@ homeassistant/components/beewi_smartclim/* @alemuro
homeassistant/components/bitcoin/* @fabaff
homeassistant/components/bizkaibus/* @UgaitzEtxebarria
homeassistant/components/blink/* @fronzbot
homeassistant/components/bmp280/* @belidzs
homeassistant/components/bmw_connected_drive/* @gerard33
homeassistant/components/bom/* @maddenp
homeassistant/components/braviatv/* @robbiet480
@@ -80,12 +82,13 @@ homeassistant/components/darksky/* @fabaff
homeassistant/components/deconz/* @kane610
homeassistant/components/delijn/* @bollewolle
homeassistant/components/demo/* @home-assistant/core
homeassistant/components/denonavr/* @scarface-4711 @starkillerOG
homeassistant/components/derivative/* @afaucogney
homeassistant/components/device_automation/* @home-assistant/core
homeassistant/components/digital_ocean/* @fabaff
homeassistant/components/directv/* @ctalkington
homeassistant/components/discogs/* @thibmaek
homeassistant/components/doorbird/* @oblogic7
homeassistant/components/doorbird/* @oblogic7 @bdraco
homeassistant/components/dsmr_reader/* @depl0y
homeassistant/components/dweet/* @fabaff
homeassistant/components/dynalite/* @ziv1234
@@ -96,6 +99,7 @@ homeassistant/components/edl21/* @mtdcr
homeassistant/components/egardia/* @jeroenterheerdt
homeassistant/components/eight_sleep/* @mezz64
homeassistant/components/elgato/* @frenck
homeassistant/components/elkm1/* @bdraco
homeassistant/components/elv/* @majuss
homeassistant/components/emby/* @mezz64
homeassistant/components/emoncms/* @borpin
@@ -122,7 +126,7 @@ homeassistant/components/fortigate/* @kifeo
homeassistant/components/fortios/* @kimfrellsen
homeassistant/components/foscam/* @skgsergio
homeassistant/components/foursquare/* @robbiet480
homeassistant/components/freebox/* @snoof85
homeassistant/components/freebox/* @snoof85 @Quentame
homeassistant/components/fronius/* @nielstron
homeassistant/components/frontend/* @home-assistant/frontend
homeassistant/components/garmin_connect/* @cyberjunky
@@ -146,7 +150,7 @@ homeassistant/components/griddy/* @bdraco
homeassistant/components/group/* @home-assistant/core
homeassistant/components/growatt_server/* @indykoning
homeassistant/components/gtfs/* @robbiet480
homeassistant/components/harmony/* @ehendrix23
homeassistant/components/harmony/* @ehendrix23 @bramkragten @bdraco
homeassistant/components/hassio/* @home-assistant/hass-io
homeassistant/components/heatmiser/* @andylockran
homeassistant/components/heos/* @andrewsayre
@@ -183,6 +187,7 @@ homeassistant/components/intesishome/* @jnimmo
homeassistant/components/ios/* @robbiet480
homeassistant/components/iperf3/* @rohankapoorcom
homeassistant/components/ipma/* @dgomes @abmantis
homeassistant/components/ipp/* @ctalkington
homeassistant/components/iqvia/* @bachya
homeassistant/components/irish_rail_transport/* @ttroy50
homeassistant/components/izone/* @Swamp-Ig
@@ -210,6 +215,7 @@ homeassistant/components/luci/* @fbradyirl @mzdrale
homeassistant/components/luftdaten/* @fabaff
homeassistant/components/lupusec/* @majuss
homeassistant/components/lutron/* @JonGilmore
homeassistant/components/lutron_caseta/* @swails
homeassistant/components/mastodon/* @fabaff
homeassistant/components/matrix/* @tinloaf
homeassistant/components/mcp23017/* @jardiamj
@@ -226,12 +232,13 @@ homeassistant/components/min_max/* @fabaff
homeassistant/components/minecraft_server/* @elmurato
homeassistant/components/minio/* @tkislan
homeassistant/components/mobile_app/* @robbiet480
homeassistant/components/modbus/* @adamchengtkc
homeassistant/components/modbus/* @adamchengtkc @janiversen
homeassistant/components/monoprice/* @etsinko
homeassistant/components/moon/* @fabaff
homeassistant/components/mpd/* @fabaff
homeassistant/components/mqtt/* @home-assistant/core
homeassistant/components/msteams/* @peroyvind
homeassistant/components/myq/* @bdraco
homeassistant/components/mysensors/* @MartinHjelmare
homeassistant/components/mystrom/* @fabaff
homeassistant/components/neato/* @dshokouhi @Santobert
@@ -241,7 +248,9 @@ homeassistant/components/ness_alarm/* @nickw444
homeassistant/components/nest/* @awarecan
homeassistant/components/netatmo/* @cgtobi
homeassistant/components/netdata/* @fabaff
homeassistant/components/nexia/* @ryannazaretian @bdraco
homeassistant/components/nextbus/* @vividboarder
homeassistant/components/nextcloud/* @meichthys
homeassistant/components/nilu/* @hfurubotten
homeassistant/components/nissan_leaf/* @filcole
homeassistant/components/nmbs/* @thibmaek
@@ -250,7 +259,9 @@ homeassistant/components/notify/* @home-assistant/core
homeassistant/components/notion/* @bachya
homeassistant/components/nsw_fuel_station/* @nickw444
homeassistant/components/nsw_rural_fire_service_feed/* @exxamalte
homeassistant/components/nuheat/* @bdraco
homeassistant/components/nuki/* @pvizeli
homeassistant/components/nut/* @bdraco
homeassistant/components/nws/* @MatthewFlamm
homeassistant/components/nzbget/* @chriscla
homeassistant/components/obihai/* @dshokouhi
@@ -275,17 +286,21 @@ homeassistant/components/plaato/* @JohNan
homeassistant/components/plant/* @ChristianKuehnel
homeassistant/components/plex/* @jjlawren
homeassistant/components/plugwise/* @laetificat @CoMPaTech @bouwew
homeassistant/components/plum_lightpad/* @ColinHarrington
homeassistant/components/point/* @fredrike
homeassistant/components/powerwall/* @bdraco
homeassistant/components/proxmoxve/* @k4ds3
homeassistant/components/ps4/* @ktnrg45
homeassistant/components/ptvsd/* @swamp-ig
homeassistant/components/push/* @dgomes
homeassistant/components/pvoutput/* @fabaff
homeassistant/components/pvpc_hourly_pricing/* @azogue
homeassistant/components/qld_bushfire/* @exxamalte
homeassistant/components/qnap/* @colinodell
homeassistant/components/quantum_gateway/* @cisasteelersfan
homeassistant/components/qvr_pro/* @oblogic7
homeassistant/components/qwikswitch/* @kellerza
homeassistant/components/rachio/* @bdraco
homeassistant/components/rainbird/* @konikvranik
homeassistant/components/raincloud/* @vanstinator
homeassistant/components/rainforest_eagle/* @gtdiehl @jcalbert
@@ -302,6 +317,7 @@ homeassistant/components/saj/* @fredericvl
homeassistant/components/salt/* @bjornorri
homeassistant/components/samsungtv/* @escoand
homeassistant/components/scene/* @home-assistant/core
homeassistant/components/schluter/* @prairieapps
homeassistant/components/scrape/* @fabaff
homeassistant/components/script/* @home-assistant/core
homeassistant/components/search/* @home-assistant/core
@@ -331,6 +347,7 @@ homeassistant/components/solax/* @squishykid
homeassistant/components/soma/* @ratsept
homeassistant/components/somfy/* @tetienne
homeassistant/components/songpal/* @rytilahti
homeassistant/components/sonos/* @amelchio
homeassistant/components/spaceapi/* @fabaff
homeassistant/components/speedtestdotnet/* @rohankapoorcom
homeassistant/components/spider/* @peternijssen
@@ -354,7 +371,7 @@ homeassistant/components/switchmate/* @danielhiversen
homeassistant/components/syncthru/* @nielstron
homeassistant/components/synology_srm/* @aerialls
homeassistant/components/syslog/* @fabaff
homeassistant/components/tado/* @michaelarnauts
homeassistant/components/tado/* @michaelarnauts @bdraco
homeassistant/components/tahoma/* @philklei
homeassistant/components/tankerkoenig/* @guillempages
homeassistant/components/tautulli/* @ludeeus
+17
View File
@@ -0,0 +1,17 @@
ARG BUILD_FROM
FROM ${BUILD_FROM}
WORKDIR /usr/src
## Setup Home Assistant
COPY . homeassistant/
RUN pip3 install --no-cache-dir --no-index --only-binary=:all: --find-links "${WHEELS_LINKS}" \
-r homeassistant/requirements_all.txt -c homeassistant/homeassistant/package_constraints.txt \
&& pip3 install --no-cache-dir --no-index --only-binary=:all: --find-links "${WHEELS_LINKS}" \
-e ./homeassistant \
&& python3 -m compileall homeassistant/homeassistant
# Home Assistant S6-Overlay
COPY rootfs /
WORKDIR /config
+3 -5
View File
@@ -14,7 +14,7 @@ schedules:
always: true
variables:
- name: versionBuilder
value: '6.9'
value: '7.2.0'
- group: docker
- group: github
- group: twine
@@ -108,11 +108,9 @@ stages:
docker run --rm --privileged \
-v ~/.docker:/root/.docker:rw \
-v /run/docker.sock:/run/docker.sock:rw \
-v $(pwd):/homeassistant:ro \
-v $(pwd):/data:ro \
homeassistant/amd64-builder:$(versionBuilder) \
--homeassistant $(homeassistantRelease) "--$(buildArch)" \
-r https://github.com/home-assistant/hassio-homeassistant \
-t generic --docker-hub homeassistant
--generic $(homeassistantRelease) "--$(buildArch)" -t /data \
docker run --rm --privileged \
-v ~/.docker:/root/.docker \
+1 -1
View File
@@ -7,7 +7,7 @@ trigger:
- dev
pr: none
schedules:
- cron: "30 0 * * *"
- cron: "0 0 * * *"
displayName: "translation update"
branches:
include:
+4 -5
View File
@@ -5,6 +5,7 @@ trigger:
branches:
include:
- dev
- rc
paths:
include:
- requirements_all.txt
@@ -18,7 +19,7 @@ schedules:
always: true
variables:
- name: versionWheels
value: '1.4-3.7-alpine3.10'
value: '1.10.1-3.7-alpine3.11'
resources:
repositories:
- repository: azure
@@ -32,8 +33,10 @@ jobs:
builderVersion: '$(versionWheels)'
builderApk: 'build-base;cmake;git;linux-headers;bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;autoconf;automake;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev'
builderPip: 'Cython;numpy'
skipBinary: 'aiohttp'
wheelsRequirement: 'requirements_wheels.txt'
wheelsRequirementDiff: 'requirements_diff.txt'
wheelsConstraint: 'homeassistant/package_constraints.txt'
preBuild:
- script: |
cp requirements_all.txt requirements_wheels.txt
@@ -69,9 +72,5 @@ jobs:
sed -i "s|# py_noaa|py_noaa|g" ${requirement_file}
sed -i "s|# bme680|bme680|g" ${requirement_file}
sed -i "s|# python-gammu|python-gammu|g" ${requirement_file}
if [[ "$(buildArch)" =~ arm ]]; then
sed -i "s|# VL53L1X|VL53L1X|g" ${requirement_file}
fi
done
displayName: 'Prepare requirements files for Hass.io'
+14
View File
@@ -0,0 +1,14 @@
{
"image": "homeassistant/{arch}-homeassistant",
"build_from": {
"aarch64": "homeassistant/aarch64-homeassistant-base:7.1.0",
"armhf": "homeassistant/armhf-homeassistant-base:7.1.0",
"armv7": "homeassistant/armv7-homeassistant-base:7.1.0",
"amd64": "homeassistant/amd64-homeassistant-base:7.1.0",
"i386": "homeassistant/i386-homeassistant-base:7.1.0"
},
"labels": {
"io.hass.type": "core"
},
"version_tag": true
}
+29
View File
@@ -0,0 +1,29 @@
:mod:`homeassistant.auth`
=========================
.. automodule:: homeassistant.auth
:members:
homeassistant.auth.auth\_store
------------------------------
.. automodule:: homeassistant.auth.auth_store
:members:
:undoc-members:
:show-inheritance:
homeassistant.auth.const
------------------------
.. automodule:: homeassistant.auth.const
:members:
:undoc-members:
:show-inheritance:
homeassistant.auth.models
-------------------------
.. automodule:: homeassistant.auth.models
:members:
:undoc-members:
:show-inheritance:
+1 -1
View File
@@ -1,7 +1,7 @@
.. _bootstrap_module:
:mod:`homeassistant.bootstrap`
-------------------------
------------------------------
.. automodule:: homeassistant.bootstrap
:members:
+170
View File
@@ -0,0 +1,170 @@
:mod:`homeassistant.components`
===============================
air\_quality
--------------------------------------------
.. automodule:: homeassistant.components.air_quality
:members:
:undoc-members:
:show-inheritance:
alarm\_control\_panel
--------------------------------------------
.. automodule:: homeassistant.components.alarm_control_panel
:members:
:undoc-members:
:show-inheritance:
binary\_sensor
--------------------------------------------
.. automodule:: homeassistant.components.binary_sensor
:members:
:undoc-members:
:show-inheritance:
camera
---------------------------
.. automodule:: homeassistant.components.camera
:members:
:undoc-members:
:show-inheritance:
calendar
---------------------------
.. automodule:: homeassistant.components.calendar
:members:
:undoc-members:
:show-inheritance:
climate
---------------------------
.. automodule:: homeassistant.components.climate
:members:
:undoc-members:
:show-inheritance:
conversation
---------------------------
.. automodule:: homeassistant.components.conversation
:members:
:undoc-members:
:show-inheritance:
cover
---------------------------
.. automodule:: homeassistant.components.cover
:members:
:undoc-members:
:show-inheritance:
device\_tracker
---------------------------
.. automodule:: homeassistant.components.device_tracker
:members:
:undoc-members:
:show-inheritance:
fan
---------------------------
.. automodule:: homeassistant.components.fan
:members:
:undoc-members:
:show-inheritance:
light
---------------------------
.. automodule:: homeassistant.components.light
:members:
:undoc-members:
:show-inheritance:
lock
---------------------------
.. automodule:: homeassistant.components.lock
:members:
:undoc-members:
:show-inheritance:
media\_player
---------------------------
.. automodule:: homeassistant.components.media_player
:members:
:undoc-members:
:show-inheritance:
notify
---------------------------
.. automodule:: homeassistant.components.notify
:members:
:undoc-members:
:show-inheritance:
remote
---------------------------
.. automodule:: homeassistant.components.remote
:members:
:undoc-members:
:show-inheritance:
switch
---------------------------
.. automodule:: homeassistant.components.switch
:members:
:undoc-members:
:show-inheritance:
sensor
-------------------------------------
.. automodule:: homeassistant.components.sensor
:members:
:undoc-members:
:show-inheritance:
vacuum
-------------------------------------
.. automodule:: homeassistant.components.vacuum
:members:
:undoc-members:
:show-inheritance:
water\_heater
-------------------------------------
.. automodule:: homeassistant.components.water_heater
:members:
:undoc-members:
:show-inheritance:
weather
---------------------------
.. automodule:: homeassistant.components.weather
:members:
:undoc-members:
:show-inheritance:
webhook
---------------------------
.. automodule:: homeassistant.components.webhook
:members:
:undoc-members:
:show-inheritance:
+7
View File
@@ -0,0 +1,7 @@
.. _config_entries_module:
:mod:`homeassistant.config_entries`
-----------------------------------
.. automodule:: homeassistant.config_entries
:members:
+1 -32
View File
@@ -4,35 +4,4 @@
-------------------------
.. automodule:: homeassistant.core
.. autoclass:: Config
:members:
.. autoclass:: Event
:members:
.. autoclass:: EventBus
:members:
.. autoclass:: HomeAssistant
:members:
.. autoclass:: State
:members:
.. autoclass:: StateMachine
:members:
.. autoclass:: ServiceCall
:members:
.. autoclass:: ServiceRegistry
:members:
Module contents
---------------
.. automodule:: homeassistant.core
:members:
:undoc-members:
:show-inheritance:
:members:
+7
View File
@@ -0,0 +1,7 @@
.. _data_entry_flow_module:
:mod:`homeassistant.data_entry_flow`
-----------------------------
.. automodule:: homeassistant.data_entry_flow
:members:
-10
View File
@@ -1,10 +0,0 @@
.. _components_device_tracker_module:
:mod:`homeassistant.components.device_tracker`
----------------------------------------------
.. automodule:: homeassistant.components.device_tracker
:members:
.. autoclass:: Device
:members:
-12
View File
@@ -1,12 +0,0 @@
.. _helpers_entity_module:
:mod:`homeassistant.helpers.entity`
-----------------------------------
.. automodule:: homeassistant.helpers.entity
.. autoclass:: Entity
:members:
.. autoclass:: ToggleEntity
:members:
-20
View File
@@ -1,20 +0,0 @@
.. _helpers_event_module:
:mod:`homeassistant.helpers.event`
----------------------------------
.. automodule:: homeassistant.helpers.event
.. autofunction:: track_state_change
.. autofunction:: track_point_in_time
.. autofunction:: track_point_in_utc_time
.. autofunction:: track_sunrise
.. autofunction:: track_sunset
.. autofunction:: track_utc_time_change
.. autofunction:: track_time_change
+7
View File
@@ -0,0 +1,7 @@
.. _exceptions_module:
:mod:`homeassistant.exceptions`
-------------------------------
.. automodule:: homeassistant.exceptions
:members:
+333 -285
View File
@@ -1,287 +1,335 @@
homeassistant.helpers package
=============================
Submodules
----------
homeassistant.helpers.aiohttp_client module
-------------------------------------------
.. automodule:: homeassistant.helpers.aiohttp_client
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.area_registry module
------------------------------------------
.. automodule:: homeassistant.helpers.area_registry
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.condition module
--------------------------------------
.. automodule:: homeassistant.helpers.condition
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.config_entry_flow module
----------------------------------------------
.. automodule:: homeassistant.helpers.config_entry_flow
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.config_validation module
----------------------------------------------
.. automodule:: homeassistant.helpers.config_validation
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.data_entry_flow module
--------------------------------------------
.. automodule:: homeassistant.helpers.data_entry_flow
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.deprecation module
----------------------------------------
.. automodule:: homeassistant.helpers.deprecation
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.device_registry module
--------------------------------------------
.. automodule:: homeassistant.helpers.device_registry
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.discovery module
--------------------------------------
.. automodule:: homeassistant.helpers.discovery
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.dispatcher module
---------------------------------------
.. automodule:: homeassistant.helpers.dispatcher
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.entity module
-----------------------------------
.. automodule:: homeassistant.helpers.entity
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.entity_component module
---------------------------------------------
.. automodule:: homeassistant.helpers.entity_component
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.entity_platform module
--------------------------------------------
.. automodule:: homeassistant.helpers.entity_platform
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.entity_registry module
--------------------------------------------
.. automodule:: homeassistant.helpers.entity_registry
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.entity_values module
------------------------------------------
.. automodule:: homeassistant.helpers.entity_values
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.entityfilter module
-----------------------------------------
.. automodule:: homeassistant.helpers.entityfilter
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.event module
----------------------------------
.. automodule:: homeassistant.helpers.event
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.icon module
---------------------------------
.. automodule:: homeassistant.helpers.icon
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.intent module
-----------------------------------
.. automodule:: homeassistant.helpers.intent
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.json module
---------------------------------
.. automodule:: homeassistant.helpers.json
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.location module
-------------------------------------
.. automodule:: homeassistant.helpers.location
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.logging module
------------------------------------
.. automodule:: homeassistant.helpers.logging
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.restore_state module
------------------------------------------
.. automodule:: homeassistant.helpers.restore_state
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.script module
-----------------------------------
.. automodule:: homeassistant.helpers.script
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.service module
------------------------------------
.. automodule:: homeassistant.helpers.service
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.signal module
-----------------------------------
.. automodule:: homeassistant.helpers.signal
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.state module
----------------------------------
.. automodule:: homeassistant.helpers.state
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.storage module
------------------------------------
.. automodule:: homeassistant.helpers.storage
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.sun module
--------------------------------
.. automodule:: homeassistant.helpers.sun
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.system_info module
----------------------------------------
.. automodule:: homeassistant.helpers.system_info
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.temperature module
----------------------------------------
.. automodule:: homeassistant.helpers.temperature
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.template module
-------------------------------------
.. automodule:: homeassistant.helpers.template
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.translation module
-----------------------------------------
.. automodule:: homeassistant.helpers.translation
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.typing module
-----------------------------------
.. automodule:: homeassistant.helpers.typing
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
:mod:`homeassistant.helpers`
============================
.. automodule:: homeassistant.helpers
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.aiohttp\_client
-------------------------------------
.. automodule:: homeassistant.helpers.aiohttp_client
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.area\_registry
------------------------------------
.. automodule:: homeassistant.helpers.area_registry
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.check\_config
-----------------------------------
.. automodule:: homeassistant.helpers.check_config
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.collection
--------------------------------
.. automodule:: homeassistant.helpers.collection
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.condition
-------------------------------
.. automodule:: homeassistant.helpers.condition
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.config\_entry\_flow
-----------------------------------------
.. automodule:: homeassistant.helpers.config_entry_flow
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.config\_entry\_oauth2\_flow
-------------------------------------------------
.. automodule:: homeassistant.helpers.config_entry_oauth2_flow
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.config\_validation
----------------------------------------
.. automodule:: homeassistant.helpers.config_validation
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.data\_entry\_flow
---------------------------------------
.. automodule:: homeassistant.helpers.data_entry_flow
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.debounce
------------------------------
.. automodule:: homeassistant.helpers.debounce
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.deprecation
---------------------------------
.. automodule:: homeassistant.helpers.deprecation
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.device\_registry
--------------------------------------
.. automodule:: homeassistant.helpers.device_registry
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.discovery
-------------------------------
.. automodule:: homeassistant.helpers.discovery
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.dispatcher
--------------------------------
.. automodule:: homeassistant.helpers.dispatcher
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.entity
----------------------------
.. automodule:: homeassistant.helpers.entity
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.entity\_component
---------------------------------------
.. automodule:: homeassistant.helpers.entity_component
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.entity\_platform
--------------------------------------
.. automodule:: homeassistant.helpers.entity_platform
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.entity\_registry
--------------------------------------
.. automodule:: homeassistant.helpers.entity_registry
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.entity\_values
------------------------------------
.. automodule:: homeassistant.helpers.entity_values
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.entityfilter
----------------------------------
.. automodule:: homeassistant.helpers.entityfilter
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.event
---------------------------
.. automodule:: homeassistant.helpers.event
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.icon
--------------------------
.. automodule:: homeassistant.helpers.icon
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.integration\_platform
-------------------------------------------
.. automodule:: homeassistant.helpers.integration_platform
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.intent
----------------------------
.. automodule:: homeassistant.helpers.intent
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.json
--------------------------
.. automodule:: homeassistant.helpers.json
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.location
------------------------------
.. automodule:: homeassistant.helpers.location
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.logging
-----------------------------
.. automodule:: homeassistant.helpers.logging
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.network
-----------------------------
.. automodule:: homeassistant.helpers.network
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.restore\_state
------------------------------------
.. automodule:: homeassistant.helpers.restore_state
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.script
----------------------------
.. automodule:: homeassistant.helpers.script
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.service
-----------------------------
.. automodule:: homeassistant.helpers.service
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.signal
-----------------------------
.. automodule:: homeassistant.helpers.signal
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.state
---------------------------
.. automodule:: homeassistant.helpers.state
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.storage
-----------------------------
.. automodule:: homeassistant.helpers.storage
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.sun
-------------------------
.. automodule:: homeassistant.helpers.sun
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.system\_info
----------------------------------
.. automodule:: homeassistant.helpers.system_info
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.temperature
---------------------------------
.. automodule:: homeassistant.helpers.temperature
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.template
------------------------------
.. automodule:: homeassistant.helpers.template
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.translation
---------------------------------
.. automodule:: homeassistant.helpers.translation
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.typing
----------------------------
.. automodule:: homeassistant.helpers.typing
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.update\_coordinator
-----------------------------------------
.. automodule:: homeassistant.helpers.update_coordinator
:members:
:undoc-members:
:show-inheritance:
-70
View File
@@ -1,70 +0,0 @@
homeassistant package
=====================
Subpackages
-----------
.. toctree::
helpers
util
Submodules
----------
bootstrap module
------------------------------
.. automodule:: homeassistant.bootstrap
:members:
:undoc-members:
:show-inheritance:
config module
---------------------------
.. automodule:: homeassistant.config
:members:
:undoc-members:
:show-inheritance:
const module
--------------------------
.. automodule:: homeassistant.const
:members:
:undoc-members:
:show-inheritance:
core module
-------------------------
.. automodule:: homeassistant.core
:members:
:undoc-members:
:show-inheritance:
exceptions module
-------------------------------
.. automodule:: homeassistant.exceptions
:members:
:undoc-members:
:show-inheritance:
loader module
---------------------------
.. automodule:: homeassistant.loader
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: homeassistant
:members:
:undoc-members:
:show-inheritance:
+7
View File
@@ -0,0 +1,7 @@
.. _loader_module:
:mod:`homeassistant.loader`
---------------------------
.. automodule:: homeassistant.loader
:members:
+157 -84
View File
@@ -1,86 +1,159 @@
homeassistant.util package
==========================
Submodules
----------
homeassistant.util.async_ module
-------------------------------
.. automodule:: homeassistant.util.async_
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.color module
-------------------------------
.. automodule:: homeassistant.util.color
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.distance module
----------------------------------
.. automodule:: homeassistant.util.distance
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.dt module
----------------------------
.. automodule:: homeassistant.util.dt
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.location module
----------------------------------
.. automodule:: homeassistant.util.location
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.package module
---------------------------------
.. automodule:: homeassistant.util.package
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.temperature module
-------------------------------------
.. automodule:: homeassistant.util.temperature
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.unit_system module
-------------------------------------
.. automodule:: homeassistant.util.unit_system
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.yaml module
------------------------------
.. automodule:: homeassistant.util.yaml
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
:mod:`homeassistant.util`
=========================
.. automodule:: homeassistant.util
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.yaml
-----------------------
.. automodule:: homeassistant.util.yaml
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.aiohttp
--------------------------
.. automodule:: homeassistant.util.aiohttp
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.async\_
--------------------------
.. automodule:: homeassistant.util.async_
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.color
------------------------
.. automodule:: homeassistant.util.color
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.decorator
----------------------------
.. automodule:: homeassistant.util.decorator
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.distance
---------------------------
.. automodule:: homeassistant.util.distance
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.dt
---------------------
.. automodule:: homeassistant.util.dt
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.json
-----------------------
.. automodule:: homeassistant.util.json
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.location
---------------------------
.. automodule:: homeassistant.util.location
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.logging
--------------------------
.. automodule:: homeassistant.util.logging
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.network
--------------------------
.. automodule:: homeassistant.util.network
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.package
--------------------------
.. automodule:: homeassistant.util.package
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.pil
----------------------
.. automodule:: homeassistant.util.pil
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.pressure
---------------------------
.. automodule:: homeassistant.util.pressure
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.ruamel\_yaml
-------------------------------
.. automodule:: homeassistant.util.ruamel_yaml
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.ssl
----------------------
.. automodule:: homeassistant.util.ssl
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.temperature
------------------------------
.. automodule:: homeassistant.util.temperature
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.unit\_system
-------------------------------
.. automodule:: homeassistant.util.unit_system
:members:
:undoc-members:
:show-inheritance:
homeassistant.util.volume
-------------------------
.. automodule:: homeassistant.util.volume
:members:
:undoc-members:
:show-inheritance:
+1 -1
View File
@@ -26,7 +26,7 @@ from homeassistant.const import __short_version__, __version__
PROJECT_NAME = 'Home Assistant'
PROJECT_PACKAGE_NAME = 'homeassistant'
PROJECT_AUTHOR = 'The Home Assistant Authors'
PROJECT_COPYRIGHT = ' 2013-2018, {}'.format(PROJECT_AUTHOR)
PROJECT_COPYRIGHT = ' 2013-2020, {}'.format(PROJECT_AUTHOR)
PROJECT_LONG_DESCRIPTION = ('Home Assistant is an open-source '
'home automation platform running on Python 3. '
'Track and control all devices at home and '
+1 -1
View File
@@ -339,7 +339,7 @@ def main() -> int:
if args.pid_file:
write_pid(args.pid_file)
exit_code = asyncio.run(setup_and_run_hass(config_dir, args))
exit_code = asyncio.run(setup_and_run_hass(config_dir, args), debug=args.debug)
if exit_code == RESTART_EXIT_CODE and not args.runner:
try_to_restart()
+4 -2
View File
@@ -215,12 +215,14 @@ class AuthManager:
return user
async def async_create_user(self, name: str) -> models.User:
async def async_create_user(
self, name: str, group_ids: Optional[List[str]] = None
) -> models.User:
"""Create a user."""
kwargs: Dict[str, Any] = {
"name": name,
"is_active": True,
"group_ids": [GROUP_ID_ADMIN],
"group_ids": group_ids or [],
}
if await self._user_should_be_owner():
+5 -1
View File
@@ -123,4 +123,8 @@ class Credentials:
is_new = attr.ib(type=bool, default=True)
UserMeta = NamedTuple("UserMeta", [("name", Optional[str]), ("is_active", bool)])
class UserMeta(NamedTuple):
"""User metadata."""
name: Optional[str]
is_active: bool
+24 -16
View File
@@ -20,6 +20,7 @@ from homeassistant.const import (
REQUIRED_NEXT_PYTHON_VER,
)
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.typing import ConfigType
from homeassistant.setup import DATA_SETUP, async_setup_component
from homeassistant.util.logging import AsyncHandler
from homeassistant.util.package import async_get_user_site, is_virtual_env
@@ -133,7 +134,7 @@ async def async_setup_hass(
async def async_from_config_dict(
config: Dict[str, Any], hass: core.HomeAssistant
config: ConfigType, hass: core.HomeAssistant
) -> Optional[core.HomeAssistant]:
"""Try to configure Home Assistant from a configuration dictionary.
@@ -324,15 +325,30 @@ async def _async_set_up_integrations(
hass: core.HomeAssistant, config: Dict[str, Any]
) -> None:
"""Set up all the integrations."""
async def async_setup_multi_components(domains: Set[str]) -> None:
"""Set up multiple domains. Log on failure."""
futures = {
domain: hass.async_create_task(async_setup_component(hass, domain, config))
for domain in domains
}
await asyncio.wait(futures.values())
errors = [domain for domain in domains if futures[domain].exception()]
for domain in errors:
exception = futures[domain].exception()
_LOGGER.error(
"Error setting up integration %s - received exception",
domain,
exc_info=(type(exception), exception, exception.__traceback__),
)
domains = _get_domains(hass, config)
# Start up debuggers. Start these first in case they want to wait.
debuggers = domains & DEBUGGER_INTEGRATIONS
if debuggers:
_LOGGER.debug("Starting up debuggers %s", debuggers)
await asyncio.gather(
*(async_setup_component(hass, domain, config) for domain in debuggers)
)
await async_setup_multi_components(debuggers)
domains -= DEBUGGER_INTEGRATIONS
# Resolve all dependencies of all components so we can find the logging
@@ -357,9 +373,7 @@ async def _async_set_up_integrations(
if logging_domains:
_LOGGER.info("Setting up %s", logging_domains)
await asyncio.gather(
*(async_setup_component(hass, domain, config) for domain in logging_domains)
)
await async_setup_multi_components(logging_domains)
# Kick off loading the registries. They don't need to be awaited.
asyncio.gather(
@@ -369,9 +383,7 @@ async def _async_set_up_integrations(
)
if stage_1_domains:
await asyncio.gather(
*(async_setup_component(hass, domain, config) for domain in stage_1_domains)
)
await async_setup_multi_components(stage_1_domains)
# Load all integrations
after_dependencies: Dict[str, Set[str]] = {}
@@ -400,9 +412,7 @@ async def _async_set_up_integrations(
_LOGGER.debug("Setting up %s", domains_to_load)
await asyncio.gather(
*(async_setup_component(hass, domain, config) for domain in domains_to_load)
)
await async_setup_multi_components(domains_to_load)
last_load = domains_to_load
stage_2_domains -= domains_to_load
@@ -412,9 +422,7 @@ async def _async_set_up_integrations(
if stage_2_domains:
_LOGGER.debug("Final set up: %s", stage_2_domains)
await asyncio.gather(
*(async_setup_component(hass, domain, config) for domain in stage_2_domains)
)
await async_setup_multi_components(stage_2_domains)
# Wrap up startup
await hass.async_block_till_done()
@@ -17,6 +17,6 @@
"title": "Fyll ut innloggingsinformasjonen for Abode"
}
},
"title": "Abode"
"title": ""
}
}
+3 -16
View File
@@ -263,7 +263,6 @@ def setup_abode_events(hass):
TIMELINE.TEST_GROUP,
TIMELINE.CAPTURE_GROUP,
TIMELINE.DEVICE_GROUP,
TIMELINE.AUTOMATION_EDIT_GROUP,
]
for event in events:
@@ -343,21 +342,14 @@ class AbodeDevice(Entity):
class AbodeAutomation(Entity):
"""Representation of an Abode automation."""
def __init__(self, data, automation, event=None):
def __init__(self, data, automation):
"""Initialize for Abode automation."""
self._data = data
self._automation = automation
self._event = event
async def async_added_to_hass(self):
"""Subscribe to a group of Abode timeline events."""
if self._event:
self.hass.async_add_job(
self._data.abode.events.add_event_callback,
self._event,
self._update_callback,
)
self.hass.data[DOMAIN].entity_ids.add(self.entity_id)
"""Set up automation entity."""
self.hass.data[DOMAIN].entity_ids.add(self.entity_id)
@property
def should_poll(self):
@@ -385,8 +377,3 @@ class AbodeAutomation(Entity):
def unique_id(self):
"""Return a unique ID to use for this automation."""
return self._automation.automation_id
def _update_callback(self, device):
"""Update the automation state."""
self._automation.refresh()
self.schedule_update_ha_state()
@@ -1,7 +1,10 @@
"""Support for Abode Security System binary sensors."""
import abodepy.helpers.constants as CONST
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_WINDOW,
BinarySensorDevice,
)
from . import AbodeDevice
from .const import DOMAIN
@@ -38,4 +41,6 @@ class AbodeBinarySensor(AbodeDevice, BinarySensorDevice):
@property
def device_class(self):
"""Return the class of the binary sensor."""
if self._device.get_value("is_window") == "1":
return DEVICE_CLASS_WINDOW
return self._device.generic_type
+2 -5
View File
@@ -1,6 +1,5 @@
"""Support for Abode Security System switches."""
import abodepy.helpers.constants as CONST
import abodepy.helpers.timeline as TIMELINE
from homeassistant.components.switch import SwitchDevice
from homeassistant.helpers.dispatcher import async_dispatcher_connect
@@ -24,9 +23,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
entities.append(AbodeSwitch(data, device))
for automation in data.abode.get_automations():
entities.append(
AbodeAutomationSwitch(data, automation, TIMELINE.AUTOMATION_EDIT_GROUP)
)
entities.append(AbodeAutomationSwitch(data, automation))
async_add_entities(entities)
@@ -52,7 +49,7 @@ class AbodeAutomationSwitch(AbodeAutomation, SwitchDevice):
"""A switch implementation for Abode automations."""
async def async_added_to_hass(self):
"""Subscribe Abode events."""
"""Set up trigger automation service."""
await super().async_added_to_hass()
signal = f"abode_trigger_automation_{self.entity_id}"
@@ -18,7 +18,7 @@
"data": {
"host": "Vert",
"password": "Passord",
"port": "Port",
"port": "",
"ssl": "AdGuard Hjem bruker et SSL-sertifikat",
"username": "Brukernavn",
"verify_ssl": "AdGuard Home bruker et riktig sertifikat"
@@ -3,7 +3,7 @@
"name": "AdGuard Home",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/adguard",
"requirements": ["adguardhome==0.4.1"],
"requirements": ["adguardhome==0.4.2"],
"dependencies": [],
"codeowners": ["@frenck"]
}
@@ -17,9 +17,9 @@
"name": "Navn p\u00e5 integrasjonen"
},
"description": "Sett opp Airly luftkvalitet integrering. For \u00e5 generere API-n\u00f8kkel g\u00e5 til https://developer.airly.eu/register",
"title": "Airly"
"title": ""
}
},
"title": "Airly"
"title": ""
}
}
+80 -52
View File
@@ -2,6 +2,7 @@
import asyncio
from datetime import timedelta
import logging
from math import ceil
from aiohttp.client_exceptions import ClientConnectorError
from airly import Airly
@@ -10,28 +11,40 @@ import async_timeout
from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE
from homeassistant.core import Config, HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.util import Throttle
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from .const import (
ATTR_API_ADVICE,
ATTR_API_CAQI,
ATTR_API_CAQI_DESCRIPTION,
ATTR_API_CAQI_LEVEL,
DATA_CLIENT,
DOMAIN,
MAX_REQUESTS_PER_DAY,
NO_AIRLY_SENSORS,
)
PLATFORMS = ["air_quality", "sensor"]
_LOGGER = logging.getLogger(__name__)
DEFAULT_SCAN_INTERVAL = timedelta(minutes=10)
def set_update_interval(hass, instances):
"""Set update_interval to another configured Airly instances."""
# We check how many Airly configured instances are and calculate interval to not
# exceed allowed numbers of requests.
interval = timedelta(minutes=ceil(24 * 60 / MAX_REQUESTS_PER_DAY) * instances)
if hass.data.get(DOMAIN):
for instance in hass.data[DOMAIN].values():
instance.update_interval = interval
return interval
async def async_setup(hass: HomeAssistant, config: Config) -> bool:
"""Set up configured Airly."""
hass.data[DOMAIN] = {}
hass.data[DOMAIN][DATA_CLIENT] = {}
return True
@@ -48,70 +61,85 @@ async def async_setup_entry(hass, config_entry):
)
websession = async_get_clientsession(hass)
airly = AirlyData(websession, api_key, latitude, longitude)
await airly.async_update()
hass.data[DOMAIN][DATA_CLIENT][config_entry.entry_id] = airly
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(config_entry, "air_quality")
# Change update_interval for other Airly instances
update_interval = set_update_interval(
hass, len(hass.config_entries.async_entries(DOMAIN))
)
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(config_entry, "sensor")
coordinator = AirlyDataUpdateCoordinator(
hass, websession, api_key, latitude, longitude, update_interval
)
await coordinator.async_refresh()
if not coordinator.last_update_success:
raise ConfigEntryNotReady
hass.data.setdefault(DOMAIN, {})
hass.data[DOMAIN][config_entry.entry_id] = coordinator
for component in PLATFORMS:
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(config_entry, component)
)
return True
async def async_unload_entry(hass, config_entry):
"""Unload a config entry."""
hass.data[DOMAIN][DATA_CLIENT].pop(config_entry.entry_id)
await hass.config_entries.async_forward_entry_unload(config_entry, "air_quality")
await hass.config_entries.async_forward_entry_unload(config_entry, "sensor")
return True
unload_ok = all(
await asyncio.gather(
*[
hass.config_entries.async_forward_entry_unload(config_entry, component)
for component in PLATFORMS
]
)
)
if unload_ok:
hass.data[DOMAIN].pop(config_entry.entry_id)
# Change update_interval for other Airly instances
set_update_interval(hass, len(hass.data[DOMAIN]))
return unload_ok
class AirlyData:
class AirlyDataUpdateCoordinator(DataUpdateCoordinator):
"""Define an object to hold Airly data."""
def __init__(self, session, api_key, latitude, longitude):
def __init__(self, hass, session, api_key, latitude, longitude, update_interval):
"""Initialize."""
self.latitude = latitude
self.longitude = longitude
self.airly = Airly(api_key, session)
self.data = {}
@Throttle(DEFAULT_SCAN_INTERVAL)
async def async_update(self):
"""Update Airly data."""
super().__init__(hass, _LOGGER, name=DOMAIN, update_interval=update_interval)
try:
with async_timeout.timeout(20):
measurements = self.airly.create_measurements_session_point(
self.latitude, self.longitude
)
async def _async_update_data(self):
"""Update data via library."""
data = {}
with async_timeout.timeout(20):
measurements = self.airly.create_measurements_session_point(
self.latitude, self.longitude
)
try:
await measurements.update()
except (AirlyError, ClientConnectorError) as error:
raise UpdateFailed(error)
values = measurements.current["values"]
index = measurements.current["indexes"][0]
standards = measurements.current["standards"]
values = measurements.current["values"]
index = measurements.current["indexes"][0]
standards = measurements.current["standards"]
if index["description"] == NO_AIRLY_SENSORS:
_LOGGER.error("Can't retrieve data: no Airly sensors in this area")
return
for value in values:
self.data[value["name"]] = value["value"]
for standard in standards:
self.data[f"{standard['pollutant']}_LIMIT"] = standard["limit"]
self.data[f"{standard['pollutant']}_PERCENT"] = standard["percent"]
self.data[ATTR_API_CAQI] = index["value"]
self.data[ATTR_API_CAQI_LEVEL] = index["level"].lower().replace("_", " ")
self.data[ATTR_API_CAQI_DESCRIPTION] = index["description"]
self.data[ATTR_API_ADVICE] = index["advice"]
_LOGGER.debug("Data retrieved from Airly")
except asyncio.TimeoutError:
_LOGGER.error("Asyncio Timeout Error")
except (ValueError, AirlyError, ClientConnectorError) as error:
_LOGGER.error(error)
self.data = {}
if index["description"] == NO_AIRLY_SENSORS:
raise UpdateFailed("Can't retrieve data: no Airly sensors in this area")
for value in values:
data[value["name"]] = value["value"]
for standard in standards:
data[f"{standard['pollutant']}_LIMIT"] = standard["limit"]
data[f"{standard['pollutant']}_PERCENT"] = standard["percent"]
data[ATTR_API_CAQI] = index["value"]
data[ATTR_API_CAQI_LEVEL] = index["level"].lower().replace("_", " ")
data[ATTR_API_CAQI_DESCRIPTION] = index["description"]
data[ATTR_API_ADVICE] = index["advice"]
return data
+35 -34
View File
@@ -18,13 +18,13 @@ from .const import (
ATTR_API_PM25,
ATTR_API_PM25_LIMIT,
ATTR_API_PM25_PERCENT,
DATA_CLIENT,
DOMAIN,
)
ATTRIBUTION = "Data provided by Airly"
LABEL_ADVICE = "advice"
LABEL_AQI_DESCRIPTION = f"{ATTR_AQI}_description"
LABEL_AQI_LEVEL = f"{ATTR_AQI}_level"
LABEL_PM_2_5_LIMIT = f"{ATTR_PM_2_5}_limit"
LABEL_PM_2_5_PERCENT = f"{ATTR_PM_2_5}_percent_of_limit"
@@ -36,9 +36,11 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up Airly air_quality entity based on a config entry."""
name = config_entry.data[CONF_NAME]
data = hass.data[DOMAIN][DATA_CLIENT][config_entry.entry_id]
coordinator = hass.data[DOMAIN][config_entry.entry_id]
async_add_entities([AirlyAirQuality(data, name, config_entry.unique_id)], True)
async_add_entities(
[AirlyAirQuality(coordinator, name, config_entry.unique_id)], False
)
def round_state(func):
@@ -56,23 +58,23 @@ def round_state(func):
class AirlyAirQuality(AirQualityEntity):
"""Define an Airly air quality."""
def __init__(self, airly, name, unique_id):
def __init__(self, coordinator, name, unique_id):
"""Initialize."""
self.airly = airly
self.data = airly.data
self.coordinator = coordinator
self._name = name
self._unique_id = unique_id
self._pm_2_5 = None
self._pm_10 = None
self._aqi = None
self._icon = "mdi:blur"
self._attrs = {}
@property
def name(self):
"""Return the name."""
return self._name
@property
def should_poll(self):
"""Return the polling requirement of the entity."""
return False
@property
def icon(self):
"""Return the icon."""
@@ -82,30 +84,25 @@ class AirlyAirQuality(AirQualityEntity):
@round_state
def air_quality_index(self):
"""Return the air quality index."""
return self._aqi
return self.coordinator.data[ATTR_API_CAQI]
@property
@round_state
def particulate_matter_2_5(self):
"""Return the particulate matter 2.5 level."""
return self._pm_2_5
return self.coordinator.data[ATTR_API_PM25]
@property
@round_state
def particulate_matter_10(self):
"""Return the particulate matter 10 level."""
return self._pm_10
return self.coordinator.data[ATTR_API_PM10]
@property
def attribution(self):
"""Return the attribution."""
return ATTRIBUTION
@property
def state(self):
"""Return the CAQI description."""
return self.data[ATTR_API_CAQI_DESCRIPTION]
@property
def unique_id(self):
"""Return a unique_id for this entity."""
@@ -114,25 +111,29 @@ class AirlyAirQuality(AirQualityEntity):
@property
def available(self):
"""Return True if entity is available."""
return bool(self.data)
return self.coordinator.last_update_success
@property
def device_state_attributes(self):
"""Return the state attributes."""
self._attrs[LABEL_ADVICE] = self.data[ATTR_API_ADVICE]
self._attrs[LABEL_AQI_LEVEL] = self.data[ATTR_API_CAQI_LEVEL]
self._attrs[LABEL_PM_2_5_LIMIT] = self.data[ATTR_API_PM25_LIMIT]
self._attrs[LABEL_PM_2_5_PERCENT] = round(self.data[ATTR_API_PM25_PERCENT])
self._attrs[LABEL_PM_10_LIMIT] = self.data[ATTR_API_PM10_LIMIT]
self._attrs[LABEL_PM_10_PERCENT] = round(self.data[ATTR_API_PM10_PERCENT])
return self._attrs
return {
LABEL_AQI_DESCRIPTION: self.coordinator.data[ATTR_API_CAQI_DESCRIPTION],
LABEL_ADVICE: self.coordinator.data[ATTR_API_ADVICE],
LABEL_AQI_LEVEL: self.coordinator.data[ATTR_API_CAQI_LEVEL],
LABEL_PM_2_5_LIMIT: self.coordinator.data[ATTR_API_PM25_LIMIT],
LABEL_PM_2_5_PERCENT: round(self.coordinator.data[ATTR_API_PM25_PERCENT]),
LABEL_PM_10_LIMIT: self.coordinator.data[ATTR_API_PM10_LIMIT],
LABEL_PM_10_PERCENT: round(self.coordinator.data[ATTR_API_PM10_PERCENT]),
}
async def async_added_to_hass(self):
"""Connect to dispatcher listening for entity data notifications."""
self.coordinator.async_add_listener(self.async_write_ha_state)
async def async_will_remove_from_hass(self):
"""Disconnect from update signal."""
self.coordinator.async_remove_listener(self.async_write_ha_state)
async def async_update(self):
"""Update the entity."""
await self.airly.async_update()
if self.airly.data:
self.data = self.airly.data
self._pm_10 = self.data[ATTR_API_PM10]
self._pm_2_5 = self.data[ATTR_API_PM25]
self._aqi = self.data[ATTR_API_CAQI]
"""Update Airly entity."""
await self.coordinator.async_request_refresh()
+1 -1
View File
@@ -13,7 +13,7 @@ ATTR_API_PM25_LIMIT = "PM25_LIMIT"
ATTR_API_PM25_PERCENT = "PM25_PERCENT"
ATTR_API_PRESSURE = "PRESSURE"
ATTR_API_TEMPERATURE = "TEMPERATURE"
DATA_CLIENT = "client"
DEFAULT_NAME = "Airly"
DOMAIN = "airly"
MAX_REQUESTS_PER_DAY = 100
NO_AIRLY_SENSORS = "There are no Airly sensors in this area yet."
+22 -14
View File
@@ -18,7 +18,6 @@ from .const import (
ATTR_API_PM1,
ATTR_API_PRESSURE,
ATTR_API_TEMPERATURE,
DATA_CLIENT,
DOMAIN,
)
@@ -60,14 +59,14 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up Airly sensor entities based on a config entry."""
name = config_entry.data[CONF_NAME]
data = hass.data[DOMAIN][DATA_CLIENT][config_entry.entry_id]
coordinator = hass.data[DOMAIN][config_entry.entry_id]
sensors = []
for sensor in SENSOR_TYPES:
unique_id = f"{config_entry.unique_id}-{sensor.lower()}"
sensors.append(AirlySensor(data, name, sensor, unique_id))
sensors.append(AirlySensor(coordinator, name, sensor, unique_id))
async_add_entities(sensors, True)
async_add_entities(sensors, False)
def round_state(func):
@@ -85,10 +84,9 @@ def round_state(func):
class AirlySensor(Entity):
"""Define an Airly sensor."""
def __init__(self, airly, name, kind, unique_id):
def __init__(self, coordinator, name, kind, unique_id):
"""Initialize."""
self.airly = airly
self.data = airly.data
self.coordinator = coordinator
self._name = name
self._unique_id = unique_id
self.kind = kind
@@ -103,10 +101,15 @@ class AirlySensor(Entity):
"""Return the name."""
return f"{self._name} {SENSOR_TYPES[self.kind][ATTR_LABEL]}"
@property
def should_poll(self):
"""Return the polling requirement of the entity."""
return False
@property
def state(self):
"""Return the state."""
self._state = self.data[self.kind]
self._state = self.coordinator.data[self.kind]
if self.kind in [ATTR_API_PM1, ATTR_API_PRESSURE]:
self._state = round(self._state)
if self.kind in [ATTR_API_TEMPERATURE, ATTR_API_HUMIDITY]:
@@ -142,11 +145,16 @@ class AirlySensor(Entity):
@property
def available(self):
"""Return True if entity is available."""
return bool(self.data)
return self.coordinator.last_update_success
async def async_added_to_hass(self):
"""Connect to dispatcher listening for entity data notifications."""
self.coordinator.async_add_listener(self.async_write_ha_state)
async def async_will_remove_from_hass(self):
"""Disconnect from update signal."""
self.coordinator.async_remove_listener(self.async_write_ha_state)
async def async_update(self):
"""Update the sensor."""
await self.airly.async_update()
if self.airly.data:
self.data = self.airly.data
"""Update Airly entity."""
await self.coordinator.async_request_refresh()
@@ -19,5 +19,16 @@
}
},
"title": "AirVisual"
},
"options": {
"step": {
"init": {
"data": {
"show_on_map": "Mostra al mapa l'\u00e0rea geogr\u00e0fica monitoritzada"
},
"description": "Estableix les diferents opcions de la integraci\u00f3 AirVisual.",
"title": "Configuraci\u00f3 d'AirVisual"
}
}
}
}
@@ -1,7 +1,7 @@
{
"config": {
"abort": {
"already_configured": "Dieser API-Schl\u00fcssel wird bereits verwendet."
"already_configured": "Diese Koordinaten wurden bereits registriert."
},
"error": {
"invalid_api_key": "Ung\u00fcltiger API-Schl\u00fcssel"
@@ -11,11 +11,24 @@
"data": {
"api_key": "API-Schl\u00fcssel",
"latitude": "Breitengrad",
"longitude": "L\u00e4ngengrad"
"longitude": "L\u00e4ngengrad",
"show_on_map": "Zeigen Sie die \u00fcberwachte Geografie auf der Karte an"
},
"description": "\u00dcberwachen Sie die Luftqualit\u00e4t an einem geografischen Ort.",
"title": "Konfigurieren Sie AirVisual"
}
},
"title": "AirVisual"
},
"options": {
"step": {
"init": {
"data": {
"show_on_map": "Zeigen Sie die \u00fcberwachte Geografie auf der Karte an"
},
"description": "Legen Sie verschiedene Optionen f\u00fcr die AirVisual-Integration fest.",
"title": "Konfigurieren Sie AirVisual"
}
}
}
}
@@ -1,7 +1,7 @@
{
"config": {
"abort": {
"already_configured": "This API key is already in use."
"already_configured": "These coordinates have already been registered."
},
"error": {
"invalid_api_key": "Invalid API key"
@@ -11,7 +11,8 @@
"data": {
"api_key": "API Key",
"latitude": "Latitude",
"longitude": "Longitude"
"longitude": "Longitude",
"show_on_map": "Show monitored geography on the map"
},
"description": "Monitor air quality in a geographical location.",
"title": "Configure AirVisual"
@@ -19,5 +19,16 @@
}
},
"title": "AirVisual"
},
"options": {
"step": {
"init": {
"data": {
"show_on_map": "Mostrar geograf\u00eda monitorizada en el mapa"
},
"description": "Ajustar varias opciones para la integraci\u00f3n de AirVisual.",
"title": "Configurar AirVisual"
}
}
}
}
@@ -0,0 +1,31 @@
{
"config": {
"abort": {
"already_configured": "Cette cl\u00e9 API est d\u00e9j\u00e0 utilis\u00e9e."
},
"error": {
"invalid_api_key": "Cl\u00e9 API invalide"
},
"step": {
"user": {
"data": {
"api_key": "Cl\u00e9 API",
"latitude": "Latitude",
"longitude": "Longitude",
"show_on_map": "Afficher la g\u00e9ographie surveill\u00e9e sur la carte"
},
"description": "Surveiller la qualit\u00e9 de l\u2019air dans un emplacement g\u00e9ographique.",
"title": "Configurer AirVisual"
}
},
"title": "AirVisual"
},
"options": {
"step": {
"init": {
"description": "D\u00e9finissez diverses options pour l'int\u00e9gration d'AirVisual.",
"title": "Configurer AirVisual"
}
}
}
}
@@ -1,7 +1,7 @@
{
"config": {
"abort": {
"already_configured": "Questa chiave API \u00e8 gi\u00e0 in uso."
"already_configured": "Queste coordinate sono gi\u00e0 state registrate."
},
"error": {
"invalid_api_key": "Chiave API non valida"
@@ -19,5 +19,16 @@
}
},
"title": "AirVisual"
},
"options": {
"step": {
"init": {
"data": {
"show_on_map": "Mostra l'area geografica monitorata sulla mappa"
},
"description": "Impostare varie opzioni per l'integrazione AirVisual.",
"title": "Configurare AirVisual"
}
}
}
}
@@ -0,0 +1,34 @@
{
"config": {
"abort": {
"already_configured": "\uc774 API \ud0a4\ub294 \uc774\ubbf8 \uc0ac\uc6a9 \uc911\uc785\ub2c8\ub2e4."
},
"error": {
"invalid_api_key": "\uc798\ubabb\ub41c API \ud0a4"
},
"step": {
"user": {
"data": {
"api_key": "API \ud0a4",
"latitude": "\uc704\ub3c4",
"longitude": "\uacbd\ub3c4",
"show_on_map": "\uc9c0\ub3c4\uc5d0 \ubaa8\ub2c8\ud130\ub9c1\ub41c \uc9c0\ub9ac \uc815\ubcf4 \ud45c\uc2dc"
},
"description": "\uc9c0\ub9ac\uc801 \uc704\uce58\uc5d0\uc11c \ub300\uae30\uc9c8\uc744 \ubaa8\ub2c8\ud130\ub9c1\ud569\ub2c8\ub2e4.",
"title": "AirVisual \uad6c\uc131"
}
},
"title": "AirVisual"
},
"options": {
"step": {
"init": {
"data": {
"show_on_map": "\uc9c0\ub3c4\uc5d0 \ubaa8\ub2c8\ud130\ub9c1\ub41c \uc9c0\ub9ac \uc815\ubcf4 \ud45c\uc2dc"
},
"description": "AirVisual \ud1b5\ud569 \uad6c\uc131\uc694\uc18c\uc5d0 \ub300\ud55c \ub2e4\uc591\ud55c \uc635\uc158\uc744 \uc124\uc815\ud574\uc8fc\uc138\uc694.",
"title": "AirVisual \uad6c\uc131"
}
}
}
}
@@ -17,5 +17,13 @@
}
},
"title": "AirVisual"
},
"options": {
"step": {
"init": {
"description": "Verschidden Optioune fir d'AirVisual Integratioun d\u00e9fin\u00e9ieren.",
"title": "Airvisual ariichten"
}
}
}
}
@@ -1,7 +1,7 @@
{
"config": {
"abort": {
"already_configured": "Denne API-n\u00f8kkelen er allerede i bruk."
"already_configured": "Disse koordinatene er allerede registrert."
},
"error": {
"invalid_api_key": "Ugyldig API-n\u00f8kkel"
@@ -18,6 +18,17 @@
"title": "Konfigurer AirVisual"
}
},
"title": "AirVisual"
"title": ""
},
"options": {
"step": {
"init": {
"data": {
"show_on_map": "Vis overv\u00e5ket geografi p\u00e5 kartet"
},
"description": "Angi forskjellige alternativer for AirVisual-integrasjonen.",
"title": "Konfigurer AirVisual"
}
}
}
}
@@ -0,0 +1,34 @@
{
"config": {
"abort": {
"already_configured": "Ten klucz API jest ju\u017c w u\u017cyciu."
},
"error": {
"invalid_api_key": "Nieprawid\u0142owy klucz API"
},
"step": {
"user": {
"data": {
"api_key": "Klucz API",
"latitude": "Szeroko\u015b\u0107 geograficzna",
"longitude": "D\u0142ugo\u015b\u0107 geograficzna",
"show_on_map": "Wy\u015bwietlaj encje na mapie"
},
"description": "Monitoruj jako\u015b\u0107 powietrza w okre\u015blonej lokalizacji geograficznej.",
"title": "Konfiguracja AirVisual"
}
},
"title": "AirVisual"
},
"options": {
"step": {
"init": {
"data": {
"show_on_map": "Wy\u015bwietlaj encje na mapie"
},
"description": "Konfiguracja opcji integracji AirVisual.",
"title": "Konfiguracja AirVisual"
}
}
}
}
@@ -19,5 +19,16 @@
}
},
"title": "AirVisual"
},
"options": {
"step": {
"init": {
"data": {
"show_on_map": "\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u043c\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043d\u0430 \u043a\u0430\u0440\u0442\u0435"
},
"description": "\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 AirVisual.",
"title": "\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 AirVisual"
}
}
}
}
@@ -0,0 +1,12 @@
{
"config": {
"step": {
"user": {
"data": {
"latitude": "Zemepisn\u00e1 \u0161\u00edrka",
"longitude": "Zemepisn\u00e1 d\u013a\u017eka"
}
}
}
}
}
@@ -0,0 +1,34 @@
{
"config": {
"abort": {
"already_configured": "Ta klju\u010d API je \u017ee v uporabi."
},
"error": {
"invalid_api_key": "Neveljaven API klju\u010d"
},
"step": {
"user": {
"data": {
"api_key": "API Klju\u010d",
"latitude": "Zemljepisna \u0161irina",
"longitude": "Zemljepisna dol\u017eina",
"show_on_map": "Prika\u017ei nadzorovano obmo\u010dje na zemljevidu"
},
"description": "Spremljajte kakovost zraka na zemljepisni lokaciji.",
"title": "Nastavite AirVisual"
}
},
"title": "AirVisual"
},
"options": {
"step": {
"init": {
"data": {
"show_on_map": "Prika\u017ei nadzorovano obmo\u010dje na zemljevidu"
},
"description": "Nastavite razli\u010dne mo\u017enosti za integracijo AirVisual.",
"title": "Nastavite AirVisual"
}
}
}
}
@@ -1,7 +1,7 @@
{
"config": {
"abort": {
"already_configured": "\u6b64 API \u5bc6\u9470\u5df2\u88ab\u4f7f\u7528\u3002"
"already_configured": "\u6b64\u4e9b\u5ea7\u6a19\u5df2\u8a3b\u518a\u3002"
},
"error": {
"invalid_api_key": "API \u5bc6\u78bc\u7121\u6548"
@@ -19,5 +19,16 @@
}
},
"title": "AirVisual"
},
"options": {
"step": {
"init": {
"data": {
"show_on_map": "\u65bc\u5730\u5716\u4e0a\u986f\u793a\u76e3\u63a7\u4f4d\u7f6e\u3002"
},
"description": "\u8a2d\u5b9a AirVisual \u6574\u5408\u9078\u9805\u3002",
"title": "\u8a2d\u5b9a AirVisual"
}
}
}
}
+70 -41
View File
@@ -1,5 +1,4 @@
"""The airvisual component."""
import asyncio
import logging
from pyairvisual import Client
@@ -23,7 +22,6 @@ from homeassistant.helpers.event import async_track_time_interval
from .const import (
CONF_CITY,
CONF_COUNTRY,
CONF_GEOGRAPHIES,
DATA_CLIENT,
DEFAULT_SCAN_INTERVAL,
DOMAIN,
@@ -36,7 +34,7 @@ DATA_LISTENER = "listener"
DEFAULT_OPTIONS = {CONF_SHOW_ON_MAP: True}
CONF_NODE_ID = "node_id"
CONF_GEOGRAPHIES = "geographies"
GEOGRAPHY_COORDINATES_SCHEMA = vol.Schema(
{
@@ -70,34 +68,38 @@ CONFIG_SCHEMA = vol.Schema({DOMAIN: CLOUD_API_SCHEMA}, extra=vol.ALLOW_EXTRA)
def async_get_geography_id(geography_dict):
"""Generate a unique ID from a geography dict."""
if CONF_CITY in geography_dict:
return ",".join(
return ", ".join(
(
geography_dict[CONF_CITY],
geography_dict[CONF_STATE],
geography_dict[CONF_COUNTRY],
)
)
return ",".join(
return ", ".join(
(str(geography_dict[CONF_LATITUDE]), str(geography_dict[CONF_LONGITUDE]))
)
async def async_setup(hass, config):
"""Set up the AirVisual component."""
hass.data[DOMAIN] = {}
hass.data[DOMAIN][DATA_CLIENT] = {}
hass.data[DOMAIN][DATA_LISTENER] = {}
hass.data[DOMAIN] = {DATA_CLIENT: {}, DATA_LISTENER: {}}
if DOMAIN not in config:
return True
conf = config[DOMAIN]
hass.async_create_task(
hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_IMPORT}, data=conf
for geography in conf.get(
CONF_GEOGRAPHIES,
[{CONF_LATITUDE: hass.config.latitude, CONF_LONGITUDE: hass.config.longitude}],
):
hass.async_create_task(
hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_IMPORT},
data={CONF_API_KEY: conf[CONF_API_KEY], **geography},
)
)
)
return True
@@ -144,6 +146,45 @@ async def async_setup_entry(hass, config_entry):
return True
async def async_migrate_entry(hass, config_entry):
"""Migrate an old config entry."""
version = config_entry.version
_LOGGER.debug("Migrating from version %s", version)
# 1 -> 2: One geography per config entry
if version == 1:
version = config_entry.version = 2
# Update the config entry to only include the first geography (there is always
# guaranteed to be at least one):
data = {**config_entry.data}
geographies = data.pop(CONF_GEOGRAPHIES)
first_geography = geographies.pop(0)
first_id = async_get_geography_id(first_geography)
hass.config_entries.async_update_entry(
config_entry,
unique_id=first_id,
title=f"Cloud API ({first_id})",
data={CONF_API_KEY: config_entry.data[CONF_API_KEY], **first_geography},
)
# For any geographies that remain, create a new config entry for each one:
for geography in geographies:
hass.async_create_task(
hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_IMPORT},
data={CONF_API_KEY: config_entry.data[CONF_API_KEY], **geography},
)
)
_LOGGER.info("Migration to version %s successful", version)
return True
async def async_unload_entry(hass, config_entry):
"""Unload an AirVisual config entry."""
hass.data[DOMAIN][DATA_CLIENT].pop(config_entry.entry_id)
@@ -170,40 +211,28 @@ class AirVisualData:
self._client = client
self._hass = hass
self.data = {}
self.geography_data = config_entry.data
self.geography_id = config_entry.unique_id
self.options = config_entry.options
self.geographies = {
async_get_geography_id(geography): geography
for geography in config_entry.data[CONF_GEOGRAPHIES]
}
async def async_update(self):
"""Get new data for all locations from the AirVisual cloud API."""
tasks = []
if CONF_CITY in self.geography_data:
api_coro = self._client.api.city(
self.geography_data[CONF_CITY],
self.geography_data[CONF_STATE],
self.geography_data[CONF_COUNTRY],
)
else:
api_coro = self._client.api.nearest_city(
self.geography_data[CONF_LATITUDE], self.geography_data[CONF_LONGITUDE],
)
for geography in self.geographies.values():
if CONF_CITY in geography:
tasks.append(
self._client.api.city(
geography[CONF_CITY],
geography[CONF_STATE],
geography[CONF_COUNTRY],
)
)
else:
tasks.append(
self._client.api.nearest_city(
geography[CONF_LATITUDE], geography[CONF_LONGITUDE],
)
)
results = await asyncio.gather(*tasks, return_exceptions=True)
for geography_id, result in zip(self.geographies, results):
if isinstance(result, AirVisualError):
_LOGGER.error("Error while retrieving data: %s", result)
self.data[geography_id] = {}
continue
self.data[geography_id] = result
try:
self.data[self.geography_id] = await api_coro
except AirVisualError as err:
_LOGGER.error("Error while retrieving data: %s", err)
self.data[self.geography_id] = {}
_LOGGER.debug("Received new data")
async_dispatcher_send(self._hass, TOPIC_UPDATE)
@@ -1,5 +1,5 @@
"""Define a config flow manager for AirVisual."""
import logging
import asyncio
from pyairvisual import Client
from pyairvisual.errors import InvalidKeyError
@@ -15,15 +15,14 @@ from homeassistant.const import (
from homeassistant.core import callback
from homeassistant.helpers import aiohttp_client, config_validation as cv
from .const import CONF_GEOGRAPHIES, DOMAIN # pylint: disable=unused-import
_LOGGER = logging.getLogger("homeassistant.components.airvisual")
from . import async_get_geography_id
from .const import DOMAIN # pylint: disable=unused-import
class AirVisualFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
"""Handle an AirVisual config flow."""
VERSION = 1
VERSION = 2
CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL
@property
@@ -68,35 +67,33 @@ class AirVisualFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
if not user_input:
return await self._show_form()
await self._async_set_unique_id(user_input[CONF_API_KEY])
geo_id = async_get_geography_id(user_input)
await self._async_set_unique_id(geo_id)
websession = aiohttp_client.async_get_clientsession(self.hass)
client = Client(websession, api_key=user_input[CONF_API_KEY])
try:
await client.api.nearest_city()
except InvalidKeyError:
return await self._show_form(errors={CONF_API_KEY: "invalid_api_key"})
data = {CONF_API_KEY: user_input[CONF_API_KEY]}
if user_input.get(CONF_GEOGRAPHIES):
data[CONF_GEOGRAPHIES] = user_input[CONF_GEOGRAPHIES]
else:
data[CONF_GEOGRAPHIES] = [
{
CONF_LATITUDE: user_input.get(
CONF_LATITUDE, self.hass.config.latitude
),
CONF_LONGITUDE: user_input.get(
CONF_LONGITUDE, self.hass.config.longitude
),
}
]
return self.async_create_entry(
title=f"Cloud API (API key: {user_input[CONF_API_KEY][:4]}...)", data=data
# If this is the first (and only the first) time we've seen this API key, check
# that it's valid:
checked_keys = self.hass.data.setdefault("airvisual_checked_api_keys", set())
check_keys_lock = self.hass.data.setdefault(
"airvisual_checked_api_keys_lock", asyncio.Lock()
)
async with check_keys_lock:
if user_input[CONF_API_KEY] not in checked_keys:
try:
await client.api.nearest_city()
except InvalidKeyError:
return await self._show_form(
errors={CONF_API_KEY: "invalid_api_key"}
)
checked_keys.add(user_input[CONF_API_KEY])
return self.async_create_entry(
title=f"Cloud API ({geo_id})", data=user_input
)
class AirVisualOptionsFlowHandler(config_entries.OptionsFlow):
"""Handle an AirVisual options flow."""
@@ -5,7 +5,6 @@ DOMAIN = "airvisual"
CONF_CITY = "city"
CONF_COUNTRY = "country"
CONF_GEOGRAPHIES = "geographies"
DATA_CLIENT = "client"
+9 -6
View File
@@ -191,16 +191,19 @@ class AirVisualSensor(Entity):
}
)
geography = self._airvisual.geographies[self._geography_id]
if CONF_LATITUDE in geography:
if CONF_LATITUDE in self._airvisual.geography_data:
if self._airvisual.options[CONF_SHOW_ON_MAP]:
self._attrs[ATTR_LATITUDE] = geography[CONF_LATITUDE]
self._attrs[ATTR_LONGITUDE] = geography[CONF_LONGITUDE]
self._attrs[ATTR_LATITUDE] = self._airvisual.geography_data[
CONF_LATITUDE
]
self._attrs[ATTR_LONGITUDE] = self._airvisual.geography_data[
CONF_LONGITUDE
]
self._attrs.pop("lati", None)
self._attrs.pop("long", None)
else:
self._attrs["lati"] = geography[CONF_LATITUDE]
self._attrs["long"] = geography[CONF_LONGITUDE]
self._attrs["lati"] = self._airvisual.geography_data[CONF_LATITUDE]
self._attrs["long"] = self._airvisual.geography_data[CONF_LONGITUDE]
self._attrs.pop(ATTR_LATITUDE, None)
self._attrs.pop(ATTR_LONGITUDE, None)
@@ -16,7 +16,7 @@
"invalid_api_key": "Invalid API key"
},
"abort": {
"already_configured": "This API key is already in use."
"already_configured": "These coordinates have already been registered."
}
},
"options": {
@@ -7,10 +7,17 @@
"disarm": "Desactiva {entity_name}",
"trigger": "Dispara {entity_name}"
},
"condition_type": {
"is_armed_away": "{entity_name} est\u00e0 activada en mode 'a fora'",
"is_armed_home": "{entity_name} est\u00e0 activada en mode 'a casa'",
"is_armed_night": "{entity_name} est\u00e0 activada en mode 'nocturn'",
"is_disarmed": "{entity_name} est\u00e0 desactivada",
"is_triggered": "{entity_name} est\u00e0 disparada"
},
"trigger_type": {
"armed_away": "{entity_name} activada en mode a fora",
"armed_home": "{entity_name} activada en mode a casa",
"armed_night": "{entity_name} activada en mode nocturn",
"armed_away": "{entity_name} activada en mode 'a fora'",
"armed_home": "{entity_name} activada en mode 'a casa'",
"armed_night": "{entity_name} activada en mode 'nocturn'",
"disarmed": "{entity_name} desactivada",
"triggered": "{entity_name} disparat/ada"
}
@@ -7,6 +7,13 @@
"disarm": "Deaktivere {entity_name}",
"trigger": "Ausl\u00f6ser {entity_name}"
},
"condition_type": {
"is_armed_away": "{entity_name} ist aktiviert - Unterwegs",
"is_armed_home": "{entity_name} ist aktiviert - Zuhause",
"is_armed_night": "{entity_name} ist aktiviert - Nacht",
"is_disarmed": "{entity_name} ist deaktiviert",
"is_triggered": "{entity_name} wurde ausgel\u00f6st"
},
"trigger_type": {
"armed_away": "{entity_name} Unterwegs",
"armed_home": "{entity_name} Zuhause",
@@ -7,6 +7,13 @@
"disarm": "Disarm {entity_name}",
"trigger": "Trigger {entity_name}"
},
"condition_type": {
"is_armed_away": "{entity_name} is armed away",
"is_armed_home": "{entity_name} is armed home",
"is_armed_night": "{entity_name} is armed night",
"is_disarmed": "{entity_name} is disarmed",
"is_triggered": "{entity_name} is triggered"
},
"trigger_type": {
"armed_away": "{entity_name} armed away",
"armed_home": "{entity_name} armed home",
@@ -7,6 +7,13 @@
"disarm": "Desarmar {entity_name}",
"trigger": "Lanzar {entity_name}"
},
"condition_type": {
"is_armed_away": "{entity_name} est\u00e1 armada fuera",
"is_armed_home": "{entity_name} est\u00e1 armada en casa",
"is_armed_night": "{entity_name} est\u00e1 armada noche",
"is_disarmed": "{entity_name} est\u00e1 desarmada",
"is_triggered": "{entity_name} est\u00e1 disparada"
},
"trigger_type": {
"armed_away": "{entity_name} armado fuera",
"armed_home": "{entity_name} armado en casa",
@@ -7,6 +7,13 @@
"disarm": "D\u00e9sarmer {entity_name}",
"trigger": "D\u00e9clencheur {entity_name}"
},
"condition_type": {
"is_armed_away": "{entity_name} est arm\u00e9",
"is_armed_home": "{entity_name} est arm\u00e9 \u00e0 la maison",
"is_armed_night": "{entity_name} est arm\u00e9 la nuit",
"is_disarmed": "{entity_name} est d\u00e9sarm\u00e9",
"is_triggered": "{entity_name} est d\u00e9clench\u00e9"
},
"trigger_type": {
"armed_away": "Armer {entity_name} en mode \"sortie\"",
"armed_home": "Armer {entity_name} en mode \"maison\"",
@@ -7,11 +7,18 @@
"disarm": "Disarmare {entity_name}",
"trigger": "Attivazione {entity_name}"
},
"condition_type": {
"is_armed_away": "{entity_name} \u00e8 attivo in modalit\u00e0 fuori casa",
"is_armed_home": "{entity_name} \u00e8 attivo in modalit\u00e0 a casa",
"is_armed_night": "{entity_name} \u00e8 attivo in modalit\u00e0 notte",
"is_disarmed": "{entity_name} \u00e8 disattivo",
"is_triggered": "{entity_name} \u00e8 attivato"
},
"trigger_type": {
"armed_away": "{entity_name} armata modalit\u00e0 fuori casa",
"armed_home": "{entity_name} armata modalit\u00e0 a casa",
"armed_night": "{entity_name} armata modalit\u00e0 notte",
"disarmed": "{entity_name} disarmato",
"armed_away": "{entity_name} attivato in modalit\u00e0 fuori casa",
"armed_home": "{entity_name} attivato in modalit\u00e0 a casa",
"armed_night": "{entity_name} attivato in modalit\u00e0 notte",
"disarmed": "{entity_name} disattivato",
"triggered": "{entity_name} attivato"
}
}
@@ -7,6 +7,13 @@
"disarm": "{entity_name} \uacbd\ube44\ud574\uc81c",
"trigger": "{entity_name} \ud2b8\ub9ac\uac70"
},
"condition_type": {
"is_armed_away": "{entity_name} \uc774(\uac00) \uc678\ucd9c \uacbd\ube44\ubaa8\ub4dc \uc0c1\ud0dc\uc774\uba74",
"is_armed_home": "{entity_name} \uc774(\uac00) \uc7ac\uc2e4 \uacbd\ube44\ubaa8\ub4dc \uc0c1\ud0dc\uc774\uba74",
"is_armed_night": "{entity_name} \uc774(\uac00) \uc57c\uac04 \uacbd\ube44\ubaa8\ub4dc \uc0c1\ud0dc\uc774\uba74",
"is_disarmed": "{entity_name} \uc774(\uac00) \ud574\uc81c \uc0c1\ud0dc\uc774\uba74",
"is_triggered": "{entity_name} \uc774(\uac00) \ud2b8\ub9ac\uac70\ub418\uc5c8\uc73c\uba74"
},
"trigger_type": {
"armed_away": "{entity_name} \uc774(\uac00) \uc678\ucd9c \uacbd\ube44\ubaa8\ub4dc\ub85c \uc124\uc815\ub420 \ub54c",
"armed_home": "{entity_name} \uc774(\uac00) \uc7ac\uc2e4 \uacbd\ube44\ubaa8\ub4dc\ub85c \uc124\uc815\ub420 \ub54c",
@@ -7,6 +7,13 @@
"disarm": "{entity_name} entsch\u00e4rfen",
"trigger": "{entity_name} ausl\u00e9isen"
},
"condition_type": {
"is_armed_away": "{entity_name} ass ugeschalt fir Ennerwee",
"is_armed_home": "{entity_name} ass ugeschalt fir Doheem",
"is_armed_night": "{entity_name} ass ugeschalt fir Nuecht",
"is_disarmed": "{entity_name} ass entsch\u00e4rft",
"is_triggered": "{entity_name} ass ausgel\u00e9ist"
},
"trigger_type": {
"armed_away": "{entity_name} ugeschalt fir Ennerwee",
"armed_home": "{entity_name} ugeschalt fir Doheem",
@@ -7,6 +7,13 @@
"disarm": "Deaktiver {entity_name}",
"trigger": "Utl\u00f8ser {entity_name}"
},
"condition_type": {
"is_armed_away": "{entity_name} aktivert borte",
"is_armed_home": "{entity_name} aktivert hjemme",
"is_armed_night": "{entity_name} aktivert natt",
"is_disarmed": "{entity_name} er deaktivert",
"is_triggered": "{entity_name} er utl\u00f8st"
},
"trigger_type": {
"armed_away": "{entity_name} aktivert borte",
"armed_home": "{entity_name} aktivert hjemme",
@@ -7,6 +7,13 @@
"disarm": "rozbr\u00f3j {entity_name}",
"trigger": "wyzw\u00f3l {entity_name}"
},
"condition_type": {
"is_armed_away": "{entity_name} jest uzbrojony (poza domem)",
"is_armed_home": "{entity_name} jest uzbrojony (w domu)",
"is_armed_night": "{entity_name} jest uzbrojony (noc)",
"is_disarmed": "{entity_name} jest rozbrojony",
"is_triggered": "{entity_name} jest wyzwolony"
},
"trigger_type": {
"armed_away": "{entity_name} zostanie uzbrojony (poza domem)",
"armed_home": "{entity_name} zostanie uzbrojony (w domu)",
@@ -7,6 +7,13 @@
"disarm": "\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043e\u0445\u0440\u0430\u043d\u0443 \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u0438 {entity_name}",
"trigger": "{entity_name} \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442"
},
"condition_type": {
"is_armed_away": "\u0412\u043a\u043b\u044e\u0447\u0435\u043d \u0440\u0435\u0436\u0438\u043c \u043e\u0445\u0440\u0430\u043d\u044b \"\u041d\u0435 \u0434\u043e\u043c\u0430\" \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u0438 {entity_name}",
"is_armed_home": "\u0412\u043a\u043b\u044e\u0447\u0435\u043d \u0440\u0435\u0436\u0438\u043c \u043e\u0445\u0440\u0430\u043d\u044b \"\u0414\u043e\u043c\u0430\" \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u0438 {entity_name}",
"is_armed_night": "\u0412\u043a\u043b\u044e\u0447\u0435\u043d \u0440\u0435\u0436\u0438\u043c \u043e\u0445\u0440\u0430\u043d\u044b \"\u041d\u043e\u0447\u044c\" \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u0438 {entity_name}",
"is_disarmed": "\u041e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u043e\u0445\u0440\u0430\u043d\u0430 \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u0438 {entity_name}",
"is_triggered": "{entity_name} \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442"
},
"trigger_type": {
"armed_away": "\u0412\u043a\u043b\u044e\u0447\u0435\u043d \u0440\u0435\u0436\u0438\u043c \u043e\u0445\u0440\u0430\u043d\u044b \"\u041d\u0435 \u0434\u043e\u043c\u0430\" \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u0438 {entity_name}",
"armed_home": "\u0412\u043a\u043b\u044e\u0447\u0435\u043d \u0440\u0435\u0436\u0438\u043c \u043e\u0445\u0440\u0430\u043d\u044b \"\u0414\u043e\u043c\u0430\" \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u0438 {entity_name}",
@@ -7,6 +7,13 @@
"disarm": "Razoro\u017ei {entity_name}",
"trigger": "Spro\u017ei {entity_name}"
},
"condition_type": {
"is_armed_away": "{entity_name} je oboro\u017een na \"zdoma\"",
"is_armed_home": "{entity_name} je oboro\u017een na \"dom\"",
"is_armed_night": "{entity_name} je oboro\u017een na \"no\u010d\"",
"is_disarmed": "{entity_name} razoro\u017een",
"is_triggered": "{entity_name} spro\u017een"
},
"trigger_type": {
"armed_away": "{entity_name} oboro\u017een - zdoma",
"armed_home": "{entity_name} oboro\u017een - dom",
@@ -7,6 +7,13 @@
"disarm": "\u89e3\u9664{entity_name}",
"trigger": "\u89f8\u767c{entity_name}"
},
"condition_type": {
"is_armed_away": "{entity_name}\u8a2d\u5b9a\u5916\u51fa",
"is_armed_home": "{entity_name}\u8a2d\u5b9a\u5728\u5bb6",
"is_armed_night": "{entity_name}\u8a2d\u5b9a\u591c\u9593",
"is_disarmed": "{entity_name}\u5df2\u89e3\u9664",
"is_triggered": "{entity_name}\u5df2\u89f8\u767c"
},
"trigger_type": {
"armed_away": "{entity_name}\u8a2d\u5b9a\u5916\u51fa",
"armed_home": "{entity_name}\u8a2d\u5b9a\u5728\u5bb6",
@@ -5,3 +5,10 @@ SUPPORT_ALARM_ARM_AWAY = 2
SUPPORT_ALARM_ARM_NIGHT = 4
SUPPORT_ALARM_TRIGGER = 8
SUPPORT_ALARM_ARM_CUSTOM_BYPASS = 16
CONDITION_TRIGGERED = "is_triggered"
CONDITION_DISARMED = "is_disarmed"
CONDITION_ARMED_HOME = "is_armed_home"
CONDITION_ARMED_AWAY = "is_armed_away"
CONDITION_ARMED_NIGHT = "is_armed_night"
CONDITION_ARMED_CUSTOM_BYPASS = "is_armed_custom_bypass"
@@ -0,0 +1,162 @@
"""Provide the device automations for Alarm control panel."""
from typing import Dict, List
import voluptuous as vol
from homeassistant.components.alarm_control_panel.const import (
SUPPORT_ALARM_ARM_AWAY,
SUPPORT_ALARM_ARM_CUSTOM_BYPASS,
SUPPORT_ALARM_ARM_HOME,
SUPPORT_ALARM_ARM_NIGHT,
)
from homeassistant.const import (
ATTR_ENTITY_ID,
CONF_CONDITION,
CONF_DEVICE_ID,
CONF_DOMAIN,
CONF_ENTITY_ID,
CONF_TYPE,
STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_CUSTOM_BYPASS,
STATE_ALARM_ARMED_HOME,
STATE_ALARM_ARMED_NIGHT,
STATE_ALARM_DISARMED,
STATE_ALARM_TRIGGERED,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers import condition, config_validation as cv, entity_registry
from homeassistant.helpers.config_validation import DEVICE_CONDITION_BASE_SCHEMA
from homeassistant.helpers.typing import ConfigType, TemplateVarsType
from . import DOMAIN
from .const import (
CONDITION_ARMED_AWAY,
CONDITION_ARMED_CUSTOM_BYPASS,
CONDITION_ARMED_HOME,
CONDITION_ARMED_NIGHT,
CONDITION_DISARMED,
CONDITION_TRIGGERED,
)
CONDITION_TYPES = {
CONDITION_TRIGGERED,
CONDITION_DISARMED,
CONDITION_ARMED_HOME,
CONDITION_ARMED_AWAY,
CONDITION_ARMED_NIGHT,
CONDITION_ARMED_CUSTOM_BYPASS,
}
CONDITION_SCHEMA = DEVICE_CONDITION_BASE_SCHEMA.extend(
{
vol.Required(CONF_ENTITY_ID): cv.entity_id,
vol.Required(CONF_TYPE): vol.In(CONDITION_TYPES),
}
)
async def async_get_conditions(
hass: HomeAssistant, device_id: str
) -> List[Dict[str, str]]:
"""List device conditions for Alarm control panel devices."""
registry = await entity_registry.async_get_registry(hass)
conditions = []
# Get all the integrations entities for this device
for entry in entity_registry.async_entries_for_device(registry, device_id):
if entry.domain != DOMAIN:
continue
state = hass.states.get(entry.entity_id)
# We need a state or else we can't populate the different armed conditions
if state is None:
continue
supported_features = state.attributes["supported_features"]
# Add conditions for each entity that belongs to this integration
conditions += [
{
CONF_CONDITION: "device",
CONF_DEVICE_ID: device_id,
CONF_DOMAIN: DOMAIN,
CONF_ENTITY_ID: entry.entity_id,
CONF_TYPE: CONDITION_DISARMED,
},
{
CONF_CONDITION: "device",
CONF_DEVICE_ID: device_id,
CONF_DOMAIN: DOMAIN,
CONF_ENTITY_ID: entry.entity_id,
CONF_TYPE: CONDITION_TRIGGERED,
},
]
if supported_features & SUPPORT_ALARM_ARM_HOME:
conditions.append(
{
CONF_CONDITION: "device",
CONF_DEVICE_ID: device_id,
CONF_DOMAIN: DOMAIN,
CONF_ENTITY_ID: entry.entity_id,
CONF_TYPE: CONDITION_ARMED_HOME,
}
)
if supported_features & SUPPORT_ALARM_ARM_AWAY:
conditions.append(
{
CONF_CONDITION: "device",
CONF_DEVICE_ID: device_id,
CONF_DOMAIN: DOMAIN,
CONF_ENTITY_ID: entry.entity_id,
CONF_TYPE: CONDITION_ARMED_AWAY,
}
)
if supported_features & SUPPORT_ALARM_ARM_NIGHT:
conditions.append(
{
CONF_CONDITION: "device",
CONF_DEVICE_ID: device_id,
CONF_DOMAIN: DOMAIN,
CONF_ENTITY_ID: entry.entity_id,
CONF_TYPE: CONDITION_ARMED_NIGHT,
}
)
if supported_features & SUPPORT_ALARM_ARM_CUSTOM_BYPASS:
conditions.append(
{
CONF_CONDITION: "device",
CONF_DEVICE_ID: device_id,
CONF_DOMAIN: DOMAIN,
CONF_ENTITY_ID: entry.entity_id,
CONF_TYPE: CONDITION_ARMED_CUSTOM_BYPASS,
}
)
return conditions
def async_condition_from_config(
config: ConfigType, config_validation: bool
) -> condition.ConditionCheckerType:
"""Create a function to test a device condition."""
if config_validation:
config = CONDITION_SCHEMA(config)
if config[CONF_TYPE] == CONDITION_TRIGGERED:
state = STATE_ALARM_TRIGGERED
elif config[CONF_TYPE] == CONDITION_DISARMED:
state = STATE_ALARM_DISARMED
elif config[CONF_TYPE] == CONDITION_ARMED_HOME:
state = STATE_ALARM_ARMED_HOME
elif config[CONF_TYPE] == CONDITION_ARMED_AWAY:
state = STATE_ALARM_ARMED_AWAY
elif config[CONF_TYPE] == CONDITION_ARMED_NIGHT:
state = STATE_ALARM_ARMED_NIGHT
elif config[CONF_TYPE] == CONDITION_ARMED_CUSTOM_BYPASS:
state = STATE_ALARM_ARMED_CUSTOM_BYPASS
def test_is_state(hass: HomeAssistant, variables: TemplateVarsType) -> bool:
"""Test if an entity is a certain state."""
return condition.state(hass, config[ATTR_ENTITY_ID], state)
return test_is_state
@@ -1,18 +1,25 @@
{
"device_automation": {
"action_type": {
"arm_away": "Arm {entity_name} away",
"arm_home": "Arm {entity_name} home",
"arm_night": "Arm {entity_name} night",
"disarm": "Disarm {entity_name}",
"trigger": "Trigger {entity_name}"
},
"trigger_type": {
"triggered": "{entity_name} triggered",
"disarmed": "{entity_name} disarmed",
"armed_home": "{entity_name} armed home",
"armed_away": "{entity_name} armed away",
"armed_night": "{entity_name} armed night"
"device_automation": {
"action_type": {
"arm_away": "Arm {entity_name} away",
"arm_home": "Arm {entity_name} home",
"arm_night": "Arm {entity_name} night",
"disarm": "Disarm {entity_name}",
"trigger": "Trigger {entity_name}"
},
"condition_type": {
"is_triggered": "{entity_name} is triggered",
"is_disarmed": "{entity_name} is disarmed",
"is_armed_home": "{entity_name} is armed home",
"is_armed_away": "{entity_name} is armed away",
"is_armed_night": "{entity_name} is armed night"
},
"trigger_type": {
"triggered": "{entity_name} triggered",
"disarmed": "{entity_name} disarmed",
"armed_home": "{entity_name} armed home",
"armed_away": "{entity_name} armed away",
"armed_night": "{entity_name} armed night"
}
}
}
}
@@ -33,6 +33,7 @@ CONF_ZONE_RFID = "rfid"
CONF_ZONES = "zones"
CONF_RELAY_ADDR = "relayaddr"
CONF_RELAY_CHAN = "relaychan"
CONF_CODE_ARM_REQUIRED = "code_arm_required"
DEFAULT_DEVICE_TYPE = "socket"
DEFAULT_DEVICE_HOST = "localhost"
@@ -42,6 +43,7 @@ DEFAULT_DEVICE_BAUD = 115200
DEFAULT_AUTO_BYPASS = False
DEFAULT_PANEL_DISPLAY = False
DEFAULT_CODE_ARM_REQUIRED = True
DEFAULT_ZONE_TYPE = "opening"
@@ -105,6 +107,9 @@ CONFIG_SCHEMA = vol.Schema(
CONF_PANEL_DISPLAY, default=DEFAULT_PANEL_DISPLAY
): cv.boolean,
vol.Optional(CONF_AUTO_BYPASS, default=DEFAULT_AUTO_BYPASS): cv.boolean,
vol.Optional(
CONF_CODE_ARM_REQUIRED, default=DEFAULT_CODE_ARM_REQUIRED
): cv.boolean,
vol.Optional(CONF_ZONES): {vol.Coerce(int): ZONE_SCHEMA},
}
)
@@ -121,6 +126,7 @@ def setup(hass, config):
device = conf[CONF_DEVICE]
display = conf[CONF_PANEL_DISPLAY]
auto_bypass = conf[CONF_AUTO_BYPASS]
code_arm_required = conf[CONF_CODE_ARM_REQUIRED]
zones = conf.get(CONF_ZONES)
device_type = device[CONF_DEVICE_TYPE]
@@ -206,7 +212,11 @@ def setup(hass, config):
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, stop_alarmdecoder)
load_platform(
hass, "alarm_control_panel", DOMAIN, {CONF_AUTO_BYPASS: auto_bypass}, config
hass,
"alarm_control_panel",
DOMAIN,
{CONF_AUTO_BYPASS: auto_bypass, CONF_CODE_ARM_REQUIRED: code_arm_required},
config,
)
if zones:
@@ -21,7 +21,13 @@ from homeassistant.const import (
)
import homeassistant.helpers.config_validation as cv
from . import CONF_AUTO_BYPASS, DATA_AD, DOMAIN, SIGNAL_PANEL_MESSAGE
from . import (
CONF_AUTO_BYPASS,
CONF_CODE_ARM_REQUIRED,
DATA_AD,
DOMAIN,
SIGNAL_PANEL_MESSAGE,
)
_LOGGER = logging.getLogger(__name__)
@@ -39,7 +45,8 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
return
auto_bypass = discovery_info[CONF_AUTO_BYPASS]
entity = AlarmDecoderAlarmPanel(auto_bypass)
code_arm_required = discovery_info[CONF_CODE_ARM_REQUIRED]
entity = AlarmDecoderAlarmPanel(auto_bypass, code_arm_required)
add_entities([entity])
def alarm_toggle_chime_handler(service):
@@ -70,7 +77,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
class AlarmDecoderAlarmPanel(AlarmControlPanel):
"""Representation of an AlarmDecoder-based alarm panel."""
def __init__(self, auto_bypass):
def __init__(self, auto_bypass, code_arm_required):
"""Initialize the alarm panel."""
self._display = ""
self._name = "Alarm Panel"
@@ -85,6 +92,7 @@ class AlarmDecoderAlarmPanel(AlarmControlPanel):
self._ready = None
self._zone_bypassed = None
self._auto_bypass = auto_bypass
self._code_arm_required = code_arm_required
async def async_added_to_hass(self):
"""Register callbacks."""
@@ -140,6 +148,11 @@ class AlarmDecoderAlarmPanel(AlarmControlPanel):
"""Return the list of supported features."""
return SUPPORT_ALARM_ARM_HOME | SUPPORT_ALARM_ARM_AWAY | SUPPORT_ALARM_ARM_NIGHT
@property
def code_arm_required(self):
"""Whether the code is required for arm actions."""
return self._code_arm_required
@property
def device_state_attributes(self):
"""Return the state attributes."""
@@ -153,6 +166,7 @@ class AlarmDecoderAlarmPanel(AlarmControlPanel):
"programming_mode": self._programming_mode,
"ready": self._ready,
"zone_bypassed": self._zone_bypassed,
"code_arm_required": self._code_arm_required,
}
def alarm_disarm(self, code=None):
@@ -166,6 +180,8 @@ class AlarmDecoderAlarmPanel(AlarmControlPanel):
if self._auto_bypass:
self.hass.data[DATA_AD].send(f"{code!s}6#")
self.hass.data[DATA_AD].send(f"{code!s}2")
elif not self._code_arm_required:
self.hass.data[DATA_AD].send("#2")
def alarm_arm_home(self, code=None):
"""Send arm home command."""
@@ -173,11 +189,15 @@ class AlarmDecoderAlarmPanel(AlarmControlPanel):
if self._auto_bypass:
self.hass.data[DATA_AD].send(f"{code!s}6#")
self.hass.data[DATA_AD].send(f"{code!s}3")
elif not self._code_arm_required:
self.hass.data[DATA_AD].send("#3")
def alarm_arm_night(self, code=None):
"""Send arm night command."""
if code:
self.hass.data[DATA_AD].send(f"{code!s}7")
elif not self._code_arm_required:
self.hass.data[DATA_AD].send("#7")
def alarm_toggle_chime(self, code=None):
"""Send toggle chime command."""
@@ -1,10 +1,8 @@
{
"domain": "alarmdecoder",
"name": "AlarmDecoder",
"documentation": "https://www.home-assistant.io/integrations/alarmdecoder",
"requirements": [
"alarmdecoder==1.13.2"
],
"dependencies": [],
"codeowners": []
"domain": "alarmdecoder",
"name": "AlarmDecoder",
"documentation": "https://www.home-assistant.io/integrations/alarmdecoder",
"requirements": ["alarmdecoder==1.13.2"],
"dependencies": [],
"codeowners": ["@ajschmidt8"]
}
@@ -1,9 +1,6 @@
alarm_keypress:
description: Send custom keypresses to the alarm.
fields:
entity_id:
description: Name of the alarm control panel to trigger.
example: 'alarm_control_panel.downstairs'
keypress:
description: 'String to send to the alarm panel.'
example: '*71'
@@ -11,9 +8,6 @@ alarm_keypress:
alarm_toggle_chime:
description: Send the alarm the toggle chime command.
fields:
entity_id:
description: Name of the alarm control panel to trigger.
example: 'alarm_control_panel.downstairs'
code:
description: A required code to toggle the alarm control panel chime with.
example: 1234
@@ -1 +0,0 @@
"""The alarmdotcom component."""
@@ -1,132 +0,0 @@
"""Interfaces with Alarm.com alarm control panels."""
import logging
import re
from pyalarmdotcom import Alarmdotcom
import voluptuous as vol
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.alarm_control_panel import PLATFORM_SCHEMA
from homeassistant.components.alarm_control_panel.const import (
SUPPORT_ALARM_ARM_AWAY,
SUPPORT_ALARM_ARM_HOME,
)
from homeassistant.const import (
CONF_CODE,
CONF_NAME,
CONF_PASSWORD,
CONF_USERNAME,
STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_HOME,
STATE_ALARM_DISARMED,
)
from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = "Alarm.com"
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
{
vol.Required(CONF_PASSWORD): cv.string,
vol.Required(CONF_USERNAME): cv.string,
vol.Optional(CONF_CODE): cv.positive_int,
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
}
)
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up a Alarm.com control panel."""
name = config.get(CONF_NAME)
code = config.get(CONF_CODE)
username = config.get(CONF_USERNAME)
password = config.get(CONF_PASSWORD)
alarmdotcom = AlarmDotCom(hass, name, code, username, password)
await alarmdotcom.async_login()
async_add_entities([alarmdotcom])
class AlarmDotCom(alarm.AlarmControlPanel):
"""Representation of an Alarm.com status."""
def __init__(self, hass, name, code, username, password):
"""Initialize the Alarm.com status."""
_LOGGER.debug("Setting up Alarm.com...")
self._hass = hass
self._name = name
self._code = str(code) if code else None
self._username = username
self._password = password
self._websession = async_get_clientsession(self._hass)
self._state = None
self._alarm = Alarmdotcom(username, password, self._websession, hass.loop)
async def async_login(self):
"""Login to Alarm.com."""
await self._alarm.async_login()
async def async_update(self):
"""Fetch the latest state."""
await self._alarm.async_update()
return self._alarm.state
@property
def name(self):
"""Return the name of the alarm."""
return self._name
@property
def code_format(self):
"""Return one or more digits/characters."""
if self._code is None:
return None
if isinstance(self._code, str) and re.search("^\\d+$", self._code):
return alarm.FORMAT_NUMBER
return alarm.FORMAT_TEXT
@property
def state(self):
"""Return the state of the device."""
if self._alarm.state.lower() == "disarmed":
return STATE_ALARM_DISARMED
if self._alarm.state.lower() == "armed stay":
return STATE_ALARM_ARMED_HOME
if self._alarm.state.lower() == "armed away":
return STATE_ALARM_ARMED_AWAY
return None
@property
def supported_features(self) -> int:
"""Return the list of supported features."""
return SUPPORT_ALARM_ARM_HOME | SUPPORT_ALARM_ARM_AWAY
@property
def device_state_attributes(self):
"""Return the state attributes."""
return {"sensor_status": self._alarm.sensor_status}
async def async_alarm_disarm(self, code=None):
"""Send disarm command."""
if self._validate_code(code):
await self._alarm.async_alarm_disarm()
async def async_alarm_arm_home(self, code=None):
"""Send arm home command."""
if self._validate_code(code):
await self._alarm.async_alarm_arm_home()
async def async_alarm_arm_away(self, code=None):
"""Send arm away command."""
if self._validate_code(code):
await self._alarm.async_alarm_arm_away()
def _validate_code(self, code):
"""Validate given code."""
check = self._code is None or code == self._code
if not check:
_LOGGER.warning("Wrong code entered")
return check
@@ -1,8 +0,0 @@
{
"domain": "alarmdotcom",
"name": "Alarm.com",
"documentation": "https://www.home-assistant.io/integrations/alarmdotcom",
"requirements": ["pyalarmdotcom==0.3.2"],
"dependencies": [],
"codeowners": []
}
+1 -5
View File
@@ -98,11 +98,7 @@ async def async_setup(hass, config):
f"send command {data['request']['namespace']}/{data['request']['name']}"
)
return {
"name": "Amazon Alexa",
"message": message,
"entity_id": entity_id,
}
return {"name": "Amazon Alexa", "message": message, "entity_id": entity_id}
hass.components.logbook.async_describe_event(
DOMAIN, EVENT_ALEXA_SMART_HOME, async_describe_logbook_event
@@ -169,6 +169,11 @@ class AlexaCapability:
"""Return the supportedOperations object."""
return []
@staticmethod
def camera_stream_configurations():
"""Applicable only to CameraStreamController."""
return None
def serialize_discovery(self):
"""Serialize according to the Discovery API."""
result = {"type": "AlexaInterface", "interface": self.name(), "version": "3"}
@@ -222,6 +227,10 @@ class AlexaCapability:
if inputs:
result["inputs"] = inputs
camera_stream_configurations = self.camera_stream_configurations()
if camera_stream_configurations:
result["cameraStreamConfigurations"] = camera_stream_configurations
return result
def serialize_properties(self):
@@ -1854,3 +1863,40 @@ class AlexaTimeHoldController(AlexaCapability):
When false, Alexa does not send the Resume directive.
"""
return {"allowRemoteResume": self._allow_remote_resume}
class AlexaCameraStreamController(AlexaCapability):
"""Implements Alexa.CameraStreamController.
https://developer.amazon.com/docs/device-apis/alexa-camerastreamcontroller.html
"""
supported_locales = {
"de-DE",
"en-AU",
"en-CA",
"en-GB",
"en-IN",
"en-US",
"es-ES",
"fr-FR",
"it-IT",
"ja-JP",
}
def name(self):
"""Return the Alexa API name of this interface."""
return "Alexa.CameraStreamController"
def camera_stream_configurations(self):
"""Return cameraStreamConfigurations object."""
camera_stream_configurations = [
{
"protocols": ["HLS"],
"resolutions": [{"width": 1280, "height": 720}],
"authorizationTypes": ["NONE"],
"videoCodecs": ["H264"],
"audioCodecs": ["AAC"],
}
]
return camera_stream_configurations
@@ -1,11 +1,14 @@
"""Alexa entity adapters."""
import logging
from typing import List
from urllib.parse import urlparse
from homeassistant.components import (
alarm_control_panel,
alert,
automation,
binary_sensor,
camera,
cover,
fan,
group,
@@ -33,11 +36,13 @@ from homeassistant.const import (
TEMP_FAHRENHEIT,
)
from homeassistant.core import callback
from homeassistant.helpers import network
from homeassistant.util.decorator import Registry
from .capabilities import (
Alexa,
AlexaBrightnessController,
AlexaCameraStreamController,
AlexaChannelController,
AlexaColorController,
AlexaColorTemperatureController,
@@ -68,6 +73,8 @@ from .capabilities import (
)
from .const import CONF_DESCRIPTION, CONF_DISPLAY_CATEGORIES
_LOGGER = logging.getLogger(__name__)
ENTITY_ADAPTERS = Registry()
TRANSLATION_TABLE = dict.fromkeys(map(ord, r"}{\/|\"()[]+~!><*%"), None)
@@ -763,3 +770,41 @@ class VacuumCapabilities(AlexaEntity):
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)
@ENTITY_ADAPTERS.register(camera.DOMAIN)
class CameraCapabilities(AlexaEntity):
"""Class to represent Camera capabilities."""
def default_display_categories(self):
"""Return the display categories for this entity."""
return [DisplayCategory.CAMERA]
def interfaces(self):
"""Yield the supported interfaces."""
if self._check_requirements():
supported = self.entity.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
if supported & camera.SUPPORT_STREAM:
yield AlexaCameraStreamController(self.entity)
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)
def _check_requirements(self):
"""Check the hass URL for HTTPS scheme and port 443."""
if "stream" not in self.hass.config.components:
_LOGGER.error(
"%s requires stream component for AlexaCameraStreamController",
self.entity_id,
)
return False
url = urlparse(network.async_get_external_url(self.hass))
if url.scheme != "https" or (url.port is not None and url.port != 443):
_LOGGER.error(
"%s requires HTTPS support on port 443 for AlexaCameraStreamController",
self.entity_id,
)
return False
return True
@@ -4,6 +4,7 @@ import math
from homeassistant import core as ha
from homeassistant.components import (
camera,
cover,
fan,
group,
@@ -41,6 +42,7 @@ from homeassistant.const import (
TEMP_CELSIUS,
TEMP_FAHRENHEIT,
)
from homeassistant.helpers import network
import homeassistant.util.color as color_util
from homeassistant.util.decorator import Registry
import homeassistant.util.dt as dt_util
@@ -1523,3 +1525,28 @@ async def async_api_resume(hass, config, directive, context):
)
return directive.response()
@HANDLERS.register(("Alexa.CameraStreamController", "InitializeCameraStreams"))
async def async_api_initialize_camera_stream(hass, config, directive, context):
"""Process a InitializeCameraStreams request."""
entity = directive.entity
stream_source = await camera.async_request_stream(hass, entity.entity_id, fmt="hls")
camera_image = hass.states.get(entity.entity_id).attributes["entity_picture"]
external_url = network.async_get_external_url(hass)
payload = {
"cameraStreams": [
{
"uri": f"{external_url}{stream_source}",
"protocol": "HLS",
"resolution": {"width": 1280, "height": 720},
"authorizationType": "NONE",
"videoCodec": "H264",
"audioCodec": "AAC",
}
],
"imageUri": f"{external_url}{camera_image}",
}
return directive.response(
name="Response", namespace="Alexa.CameraStreamController", payload=payload
)
+1 -1
View File
@@ -4,6 +4,6 @@
"documentation": "https://www.home-assistant.io/integrations/alexa",
"requirements": [],
"dependencies": ["http"],
"after_dependencies": ["logbook"],
"after_dependencies": ["logbook", "camera"],
"codeowners": ["@home-assistant/cloud", "@ochlocracy"]
}
@@ -14,6 +14,6 @@
"title": "Velg autentiseringsmetode"
}
},
"title": "Almond"
"title": ""
}
}
@@ -18,6 +18,6 @@
"title": "Autensiere Ambiclimate"
}
},
"title": "Ambiclimate"
"title": ""
}
}
@@ -1,5 +1,8 @@
{
"config": {
"abort": {
"already_configured": "Cette cl\u00e9 d'application est d\u00e9j\u00e0 utilis\u00e9e."
},
"error": {
"identifier_exists": "Cl\u00e9 d'application et / ou cl\u00e9 API d\u00e9j\u00e0 enregistr\u00e9e",
"invalid_key": "Cl\u00e9 d'API et / ou cl\u00e9 d'application non valide",
@@ -17,6 +17,6 @@
"title": "Fyll ut informasjonen din"
}
},
"title": "Ambient PWS"
"title": ""
}
}
@@ -1,5 +1,8 @@
{
"config": {
"abort": {
"already_configured": "Ta klju\u010d za aplikacijo je \u017ee v uporabi."
},
"error": {
"identifier_exists": "Aplikacijski klju\u010d in / ali klju\u010d API je \u017ee registriran",
"invalid_key": "Neveljaven klju\u010d API in / ali klju\u010d aplikacije",
@@ -41,7 +41,6 @@ _LOGGER = logging.getLogger(__name__)
DATA_CONFIG = "config"
DEFAULT_SOCKET_MIN_RETRY = 15
DEFAULT_WATCHDOG_SECONDS = 5 * 60
TYPE_24HOURRAININ = "24hourrainin"
TYPE_BAROMABSIN = "baromabsin"
@@ -342,7 +341,6 @@ class AmbientStation:
self._config_entry = config_entry
self._entry_setup_complete = False
self._hass = hass
self._watchdog_listener = None
self._ws_reconnect_delay = DEFAULT_SOCKET_MIN_RETRY
self.client = client
self.stations = {}
@@ -359,21 +357,9 @@ class AmbientStation:
async def ws_connect(self):
"""Register handlers and connect to the websocket."""
async def _ws_reconnect(event_time):
"""Forcibly disconnect from and reconnect to the websocket."""
_LOGGER.debug("Watchdog expired; forcing socket reconnection")
await self.client.websocket.disconnect()
await self._attempt_connect()
def on_connect():
"""Define a handler to fire when the websocket is connected."""
_LOGGER.info("Connected to websocket")
_LOGGER.debug("Watchdog starting")
if self._watchdog_listener is not None:
self._watchdog_listener()
self._watchdog_listener = async_call_later(
self._hass, DEFAULT_WATCHDOG_SECONDS, _ws_reconnect
)
def on_data(data):
"""Define a handler to fire when the data is received."""
@@ -385,12 +371,6 @@ class AmbientStation:
self._hass, f"ambient_station_data_update_{mac_address}"
)
_LOGGER.debug("Resetting watchdog")
self._watchdog_listener()
self._watchdog_listener = async_call_later(
self._hass, DEFAULT_WATCHDOG_SECONDS, _ws_reconnect
)
def on_disconnect():
"""Define a handler to fire when the websocket is disconnected."""
_LOGGER.info("Disconnected from websocket")
@@ -520,13 +500,22 @@ class AmbientWeatherEntity(Entity):
@callback
def update():
"""Update the state."""
self.async_schedule_update_ha_state(True)
self.update_from_latest_data()
self.async_write_ha_state()
self._async_unsub_dispatcher_connect = async_dispatcher_connect(
self.hass, f"ambient_station_data_update_{self._mac_address}", update
)
self.update_from_latest_data()
async def async_will_remove_from_hass(self):
"""Disconnect dispatcher listener when removed."""
if self._async_unsub_dispatcher_connect:
self._async_unsub_dispatcher_connect()
self._async_unsub_dispatcher_connect = None
@callback
def update_from_latest_data(self):
"""Update the entity from the latest data."""
raise NotImplementedError
@@ -3,6 +3,7 @@ import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.const import ATTR_NAME
from homeassistant.core import callback
from . import (
SENSOR_TYPES,
@@ -76,7 +77,8 @@ class AmbientWeatherBinarySensor(AmbientWeatherEntity, BinarySensorDevice):
return self._state == 1
async def async_update(self):
@callback
def update_from_latest_data(self):
"""Fetch new state data for the entity."""
self._state = self._ambient.stations[self._mac_address][ATTR_LAST_DATA].get(
self._sensor_type
@@ -3,7 +3,7 @@
"name": "Ambient Weather Station",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/ambient_station",
"requirements": ["aioambient==1.0.4"],
"requirements": ["aioambient==1.1.0"],
"dependencies": [],
"codeowners": ["@bachya"]
}
@@ -2,6 +2,7 @@
import logging
from homeassistant.const import ATTR_NAME
from homeassistant.core import callback
from . import (
SENSOR_TYPES,
@@ -74,7 +75,8 @@ class AmbientWeatherSensor(AmbientWeatherEntity):
"""Return the unit of measurement."""
return self._unit
async def async_update(self):
@callback
def update_from_latest_data(self):
"""Fetch new state data for the sensor."""
if self._sensor_type == TYPE_SOLARRADIATION_LX:
# If the user requests the solarradiation_lx sensor, use the
+49 -4
View File
@@ -42,6 +42,8 @@ from .const import (
DATA_AMCREST,
DEVICES,
DOMAIN,
SENSOR_EVENT_CODE,
SERVICE_EVENT,
SERVICE_UPDATE,
)
from .helpers import service_signal
@@ -96,9 +98,11 @@ AMCREST_SCHEMA = vol.Schema(
vol.Optional(CONF_FFMPEG_ARGUMENTS, default=DEFAULT_ARGUMENTS): cv.string,
vol.Optional(CONF_SCAN_INTERVAL, default=SCAN_INTERVAL): cv.time_period,
vol.Optional(CONF_BINARY_SENSORS): vol.All(
cv.ensure_list, [vol.In(BINARY_SENSORS)]
cv.ensure_list, [vol.In(BINARY_SENSORS)], vol.Unique()
),
vol.Optional(CONF_SENSORS): vol.All(
cv.ensure_list, [vol.In(SENSORS)], vol.Unique()
),
vol.Optional(CONF_SENSORS): vol.All(cv.ensure_list, [vol.In(SENSORS)]),
vol.Optional(CONF_CONTROL_LIGHT, default=True): cv.boolean,
}
)
@@ -119,6 +123,8 @@ class AmcrestChecker(Http):
self._wrap_errors = 0
self._wrap_lock = threading.Lock()
self._wrap_login_err = False
self._wrap_event_flag = threading.Event()
self._wrap_event_flag.set()
self._unsub_recheck = None
super().__init__(
host,
@@ -134,16 +140,22 @@ class AmcrestChecker(Http):
"""Return if camera's API is responding."""
return self._wrap_errors <= MAX_ERRORS and not self._wrap_login_err
@property
def available_flag(self):
"""Return threading event flag that indicates if camera's API is responding."""
return self._wrap_event_flag
def _start_recovery(self):
self._wrap_event_flag.clear()
dispatcher_send(self._hass, service_signal(SERVICE_UPDATE, self._wrap_name))
self._unsub_recheck = track_time_interval(
self._hass, self._wrap_test_online, RECHECK_INTERVAL
)
def command(self, cmd, retries=None, timeout_cmd=None, stream=False):
def command(self, *args, **kwargs):
"""amcrest.Http.command wrapper to catch errors."""
try:
ret = super().command(cmd, retries, timeout_cmd, stream)
ret = super().command(*args, **kwargs)
except LoginError as ex:
with self._wrap_lock:
was_online = self.available
@@ -172,6 +184,7 @@ class AmcrestChecker(Http):
self._unsub_recheck()
self._unsub_recheck = None
_LOGGER.error("%s camera back online", self._wrap_name)
self._wrap_event_flag.set()
dispatcher_send(self._hass, service_signal(SERVICE_UPDATE, self._wrap_name))
return ret
@@ -184,6 +197,31 @@ class AmcrestChecker(Http):
pass
def _monitor_events(hass, name, api, event_codes):
event_codes = ",".join(event_codes)
while True:
api.available_flag.wait()
try:
for code, start in api.event_actions(event_codes, retries=5):
signal = service_signal(SERVICE_EVENT, name, code)
_LOGGER.debug("Sending signal: '%s': %s", signal, start)
dispatcher_send(hass, signal, start)
except AmcrestError as error:
_LOGGER.warning(
"Error while processing events from %s camera: %r", name, error
)
def _start_event_monitor(hass, name, api, event_codes):
thread = threading.Thread(
target=_monitor_events,
name=f"Amcrest {name}",
args=(hass, name, api, event_codes),
daemon=True,
)
thread.start()
def setup(hass, config):
"""Set up the Amcrest IP Camera component."""
hass.data.setdefault(DATA_AMCREST, {DEVICES: {}, CAMERAS: []})
@@ -230,6 +268,13 @@ def setup(hass, config):
{CONF_NAME: name, CONF_BINARY_SENSORS: binary_sensors},
config,
)
event_codes = [
BINARY_SENSORS[sensor_type][SENSOR_EVENT_CODE]
for sensor_type in binary_sensors
if BINARY_SENSORS[sensor_type][SENSOR_EVENT_CODE] is not None
]
if event_codes:
_start_event_monitor(hass, name, api, event_codes)
if sensors:
discovery.load_platform(
@@ -10,12 +10,17 @@ from homeassistant.components.binary_sensor import (
BinarySensorDevice,
)
from homeassistant.const import CONF_BINARY_SENSORS, CONF_NAME
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from .const import (
BINARY_SENSOR_SCAN_INTERVAL_SECS,
DATA_AMCREST,
DEVICES,
SENSOR_DEVICE_CLASS,
SENSOR_EVENT_CODE,
SENSOR_NAME,
SERVICE_EVENT,
SERVICE_UPDATE,
)
from .helpers import log_update_error, service_signal
@@ -26,11 +31,20 @@ SCAN_INTERVAL = timedelta(seconds=BINARY_SENSOR_SCAN_INTERVAL_SECS)
BINARY_SENSOR_MOTION_DETECTED = "motion_detected"
BINARY_SENSOR_ONLINE = "online"
# Binary sensor types are defined like: Name, device class
BINARY_SENSORS = {
BINARY_SENSOR_MOTION_DETECTED: ("Motion Detected", DEVICE_CLASS_MOTION),
BINARY_SENSOR_ONLINE: ("Online", DEVICE_CLASS_CONNECTIVITY),
BINARY_SENSOR_MOTION_DETECTED: (
"Motion Detected",
DEVICE_CLASS_MOTION,
"VideoMotion",
),
BINARY_SENSOR_ONLINE: ("Online", DEVICE_CLASS_CONNECTIVITY, None),
}
BINARY_SENSORS = {
k: dict(zip((SENSOR_NAME, SENSOR_DEVICE_CLASS, SENSOR_EVENT_CODE), v))
for k, v in BINARY_SENSORS.items()
}
_UPDATE_MSG = "Updating %s binary sensor"
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
@@ -54,18 +68,19 @@ class AmcrestBinarySensor(BinarySensorDevice):
def __init__(self, name, device, sensor_type):
"""Initialize entity."""
self._name = f"{name} {BINARY_SENSORS[sensor_type][0]}"
self._name = f"{name} {BINARY_SENSORS[sensor_type][SENSOR_NAME]}"
self._signal_name = name
self._api = device.api
self._sensor_type = sensor_type
self._state = None
self._device_class = BINARY_SENSORS[sensor_type][1]
self._unsub_dispatcher = None
self._device_class = BINARY_SENSORS[sensor_type][SENSOR_DEVICE_CLASS]
self._event_code = BINARY_SENSORS[sensor_type][SENSOR_EVENT_CODE]
self._unsub_dispatcher = []
@property
def should_poll(self):
"""Return True if entity has to be polled for state."""
return self._sensor_type != BINARY_SENSOR_ONLINE
return self._sensor_type == BINARY_SENSOR_ONLINE
@property
def name(self):
@@ -89,16 +104,34 @@ class AmcrestBinarySensor(BinarySensorDevice):
def update(self):
"""Update entity."""
if self._sensor_type == BINARY_SENSOR_ONLINE:
self._update_online()
else:
self._update_others()
def _update_online(self):
if not (self._api.available or self.is_on):
return
_LOGGER.debug(_UPDATE_MSG, self._name)
if self._api.available:
# Send a command to the camera to test if we can still communicate with it.
# Override of Http.command() in __init__.py will set self._api.available
# accordingly.
try:
self._api.current_time
except AmcrestError:
pass
self._state = self._api.available
def _update_others(self):
if not self.available:
return
_LOGGER.debug("Updating %s binary sensor", self._name)
_LOGGER.debug(_UPDATE_MSG, self._name)
try:
if self._sensor_type == BINARY_SENSOR_MOTION_DETECTED:
self._state = self._api.is_motion_detected
elif self._sensor_type == BINARY_SENSOR_ONLINE:
self._state = self._api.available
self._state = "channels" in self._api.event_channels_happened(
self._event_code
)
except AmcrestError as error:
log_update_error(_LOGGER, "update", self.name, "binary sensor", error)
@@ -106,14 +139,32 @@ class AmcrestBinarySensor(BinarySensorDevice):
"""Update state."""
self.async_schedule_update_ha_state(True)
@callback
def async_event_received(self, start):
"""Update state from received event."""
_LOGGER.debug(_UPDATE_MSG, self._name)
self._state = start
self.async_write_ha_state()
async def async_added_to_hass(self):
"""Subscribe to update signal."""
self._unsub_dispatcher = async_dispatcher_connect(
self.hass,
service_signal(SERVICE_UPDATE, self._signal_name),
self.async_on_demand_update,
"""Subscribe to signals."""
self._unsub_dispatcher.append(
async_dispatcher_connect(
self.hass,
service_signal(SERVICE_UPDATE, self._signal_name),
self.async_on_demand_update,
)
)
if self._event_code:
self._unsub_dispatcher.append(
async_dispatcher_connect(
self.hass,
service_signal(SERVICE_EVENT, self._signal_name, self._event_code),
self.async_event_received,
)
)
async def async_will_remove_from_hass(self):
"""Disconnect from update signal."""
self._unsub_dispatcher()
for unsub_dispatcher in self._unsub_dispatcher:
unsub_dispatcher()

Some files were not shown because too many files have changed in this diff Show More