Commit Graph

27706 Commits (0eaa6045c198ef15602cba8c713e38144f76f16f)

Author SHA1 Message Date
Damien Levin 78225c9ddd
Set webostv scan interval to 10s for quick updates (#35795)
Co-authored-by: damien.levin@gmail.com <damienlevin@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2020-06-22 13:08:02 +02:00
Franck Nijhof 215215747e
Fix use of AdGuard integration without version (#36995) 2020-06-22 13:06:59 +02:00
Gerard 5cd85f9f00
Upgrade to bimmer_connected 0.7.7 (#36985) 2020-06-22 13:06:18 +02:00
ktnrg45 4674cb406e
Bump pyps4-2ndscreen to 1.1.0 (#36987) 2020-06-22 13:02:18 +02:00
James Nimmo 82b77a8108
Bump to pyIntesishome 1.7.5 (#36562) 2020-06-22 12:56:29 +02:00
starkillerOG 1f9721bad3
Add Xiaomi Aqara Config Flow (#35595)
* Xiaomi Aqara Config Flow

* Xiaomi Aqara Config Flow

* Xiaomi Aqara Config Flow

* Xiaomi Aqara Config Flow

* Xiaomi Aqara Config Flow

First tested and working version

* Remove depricated discovery

* Add Xiaomi Aqara Config Flow

* Add Xiaomi Aqara tests

* Update .coveragerc

* Update requirements_test_all.txt

* fix spelling mistake

* fix select scheme

* fix wrong conflict resolve

* add IP to zeroconf discovery title

* black styling

* add getmac requirement

Co-authored-by: Maciej Bieniek <bieniu@users.noreply.github.com>

* add getmac

* add getmac

* Clean up

* Update homeassistant/components/xiaomi_aqara/__init__.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/xiaomi_aqara/__init__.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/xiaomi_aqara/__init__.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/xiaomi_aqara/__init__.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/xiaomi_aqara/__init__.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* resolve data storage

* move format_mac down

* Remove discovery_retry from config flow

* remove unused strings

* fix styling

* fix black styling

* fix tests

* remove mac connection

This is needed to prevent a conflict with the Xiaomi Miio integration that I discovered during testing.

* fix flake8

* remove getmac depandance

* check for inavlid_interface + test

* Validate gateway key

* add invalid key tests

* Fix spelling

* Only set up sensors if no key

Co-authored-by: Maciej Bieniek <bieniu@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-06-22 11:54:17 +02:00
Chris Talkington 6aba87f3a6
Use roku media state to detect paused media (#36980) 2020-06-22 09:51:38 +02:00
J. Nick Koston edad387b12
Make recorder execute avoid native conversion by default (#36938) 2020-06-21 21:58:57 -07:00
HomeAssistant Azure f4b8a95205 [ci skip] Translation update 2020-06-22 00:05:46 +00:00
David Ryan 29adc6a27b
Support Hydrawise API v1.4 (#34448)
* Now supports Hydrawise API v1.4

* Removed dependency and codeowners name.

* Update CODEOWNERS to include hydrawise

* Changes made from review comments.

* Clean up update.

* Added device class for timestamp and switch. Consolodate methods to parent class.

* Cap next_cycle at 2 years to prevent time overflow.

* Addressed review comments.

* Updated DEVICE_MAP and icon() based on review comments.
2020-06-21 16:55:47 -05:00
Andrew Hayworth fed6625324
Refactor / update Awair integration (#34394)
* Refactor / update Awair integration

This commit does a few things, all in service of making the Awair
integration more modern and reliable. Specifically we do the following:

- Update to python_awair 0.1.1
- Begin using config entries / flow for setting up the integration.
  - YAML support is completely removed.
  - The integration now allows adding multiple Awair accounts, should a
    user wish to do so (I found it _very_ useful in development).
- Group various Awair sensors into devices, using the device registry.
- Renames various sensors and treats the "dust" sensor as a particulate sensor.
- Device update rate-limits are no longer dynamically calculated; the
  Awair API now separates rate-limits on a per-device basis.
- Supports sound pressure and illuminance sensors found on some Awair devices.
- We report the "awair index" for certain sensors as part of device_state_attributes.
  The "index" is a subjective measure of whether or not a sensor reading
  is "good" or "bad" (and to what extent). It's a component of the Awair
  score, and it is useful on its own as an input for those who wish to
  do things like "display this color if the value is 'bad'".

This is a breaking change, and requires updates to documentation and a
warning in the README. The breaking changes in detail, are:

- Support for all YAML configuration is removed, and users will need to
  re-add the integration via the UI.
- We no longer support overriding device discovery via manual
  configuration of device UUIDs. This was previously supported because
  the Awair API had severe limits on the device list endpoints; however
  those have since been removed.
- Gen 1 devices no longer show a "dust" sensor; rather we create a PM2.5
  sensor and a PM10 sensor and just keep the values in sync. This better
  reflects the sensor capabilities: it can detect particles in a range
  from 2.5 -> 10, but cannot differentiate between sizes.
- Sensors are renamed as follows:
  - "sensor.devicename_co2"   -> "sensor.devicename_carbon_dioxide"
  - "sensor.devicename_voc"   -> "sensor.devicename_volatile_organic_compounds"
  - "sensor.devicename_score" -> "sensor.devicename_air_quality_index"
  - I've chosen to call the "Awair Score" an "air quality index" sensor,
    because fundamentally the "Awair Score" and other air quality indices
    (such as CAQI) do the same thing: they calculate a value based on a
    variety of other inputs.

Under the hood, the integration has seen some improvements:

- We use the DataUpdateCoordinator class to handle updates, rather than
  rolling our own update class.
- The code no longer tracks availability based on a timestamp returned
  from the Awair service; we assert that if we have received a response
  and the response has data for our device, then we are available (and
  otherwise, not available). We don't need to test the actual Awair API
  so heavily.
- Test coverage has been expanded to handle a variety of products that
  Awair produces, not just the one I happen to own.
- Test coverage no longer concerns itself with testing behavior that is
  now handled by the DataUpdateCoordinator; nor is it concerned with
  ensuring that the overall component sets up and registers properly.
  These are assumed to be well-tested functionaity of the core and not
  things we need to re-test ourselves.

Finally - between library updates and integration updates, this
integration is well-positioned to support future updates. I have a
proof-of-concept patch for device automations, and the underlying
library now supports subclassing authentication (which clears the way
for us to use OAuth authentication for Awair).

* Wrap test fixture in mock_coro

Truthfully I'm not sure why this was passing on my local dev
environment, but I was developing with python 3.8 before. After
installing python 3.7, I was able to reproduce the CI failures and fix
them.

* Fix broken tests after #34901 and/or #34989

* Do not rename sensors so broadly

We're going to keep the sensors named as they were before, pending the
outcome of any decisions around the air_quality component and what names
should be standardized for air-quality-like devices.

If standardized names are selected (which does seem likely), then we
will update this integration to match them - at which point, it would be
a breaking change.

But for now, we'll keep names mostly identical to what users had before.

Notable in this commit is that we generate the entity_id ourselves,
rather than just allowing it to be auto-generated from the name
attribute. This allows us to provide more human friendly names, while
keeping the old format for entity ids. For example, given an Awair
device called "Living Room", we'll generate an entity id of
"sensor.living_room_voc" but show set the name of the device to "Living
Room Volatile organic compounds".

* Support import from config.yaml

We'll create a config entry from config.yaml the first time we're
loaded, and then defer to it from then on.

We ignore all keys other than the access_token, since we no longer need
to deal with per-account rate-limits (rather, everything is per-device
now).

* Add myself to CODEOWNERS

Since I wrote the initial integration, and now this re-write, it feels
appropriate for me to take care of the integration along with `danielsjf`.

* Remove name mangling

* Update homeassistant/components/awair/manifest.json

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/awair/config_flow.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/awair/sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/awair/sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Address some review feedback

* Set up reauth flow in a job, rather than awaiting

* Remove unnecessary title string

* Remove unnecessary config schema checking

As pointed out in review, because this comes in via import from
`configuration.yaml`, we can rely on the `PLATFORM_SCHEMA` validation instead.

* Fix tests

* Set unique_id appropriately for legacy devices

For users who have had this integration already installed (and who have
updated their home assistant installation sometime in recent history),
we want to ensure that unique_id's are set to the same thing as before,
to facilitate the upgrade process.

To do that, we add an additional property to the `SENSOR_TYPES` dict
(`ATTR_UNIQUE_ID`) which allows us to map modern sensor names from
python_awair to what older versions called them - ie: `humidity` ->
`HUMID`. We then use that value when constructing the unique ID. This
should allow users to upgrade and not lose configuration even if entity
IDs would otherwise change (because we have changed the name format that
generates entity IDs).

One note is that for the gen1 `DUST` sensor, we have to treat it
differently. This integration used to call that a "PM2.5" sensor, but
the unique_id generated would be something like `awair_12345_DUST`. So
we special-case that sensor, and do the same thing. We do not need to
special-case the PM10 sensor for gen1 devices, because we didn't create
a PM10 sensor in the past (we do now, because the "DUST" sensor is
really a hybrid PM2.5/PM10 sensor).

* Patch async_setup_entry for two tests

* Update awair config_flow to require / use an email address for unique_id

Also, only start one re-auth flow.

* Add a few more tests, try to get coverage up.

* Add another test

* Move attribution to device_state_attributes

* Don't require email

* Switch from Union[dict, None] to Optional[dict]

* Use a mock where requested

* Fix missing constant rename

* Use async_create_task

* Bump test coverage a bit for config_flow

* s/CONF_UNIQUE_ID/UNIQUE_ID/g

* Add warning about deprecated platform config

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-06-21 21:46:07 +02:00
J. Nick Koston 1de97e3a35
Fix logbook filtering by entity id (#36973)
* Fix logbook filtering by entity_id

* remove debug
2020-06-21 14:34:47 -05:00
Chris Talkington a6536bb622
Update rokuecp to 0.5.0 (#36975)
* update rokuecp to 0.5.0

* Update requirements_all.txt

* Update requirements_test_all.txt

* add aiohttp mock for media-player

* Create media-player-close.xml

* Update media-player-close.xml

* Create media-player-play.xml

* Create active-app-pluto.xml

* Update apps.xml

* Update apps-tv.xml

* Create media-player-pause.xml

* Create media-player-live.xml

* Update __init__.py
2020-06-21 14:29:39 -05:00
J. Nick Koston 59e43ab6e4
Prefilter more logbook events in sql (#36958)
* Prefilter more logbook events in sql

Prefilter sensor events in _keep_event before humanify

Cache static attribute lookup

Reduces logbook execution time by ~35%

* fix mocking in benchmark

* Update tests for logbook users
2020-06-21 10:50:58 -07:00
Tom Brien 29f128eaad
Handle Mobile App registrations for device names containing of only emoji (#36957) 2020-06-21 18:12:15 +02:00
AJ Schmidt d88efe405e
Add armed_night state for AlarmDecoder (#36695)
* add arm night state

* quick refactor
2020-06-21 17:03:36 +02:00
Brian Rogers f866ff5f2b
Rachio Rain Delay Switch Update (#36909)
* Rain Delay Switch Update

* Fix sort

* Update names
2020-06-21 08:53:54 -05:00
Ziv efa0e1b2ac
Dynalite integration - upgrade library version (#36954) 2020-06-21 11:42:34 +02:00
Chris Talkington 4a432781ca
Reduce roku scan interval by 5s (#36966) 2020-06-21 11:40:05 +02:00
Michael J. Kidd 6c2dc521a3
Adding PM2.5 and PM2.5 24hr Average (#36967)
* Adding PM2.5 and PM2.5 24hr Average

* Corrected unit to const.py CONCENTRATION_MICROGRAMS_PER_CUBIC_METER

* Imported CONCENTRATION_MICROGRAMS_PER_CUBIC_METER for PM2.5 units

* Fixed code formatting with `black`
2020-06-20 22:14:35 -06:00
HomeAssistant Azure b112a742b2 [ci skip] Translation update 2020-06-21 00:10:03 +00:00
Franck Nijhof 46cb9cff41
Fix ESPHome discovery for ignored config entries (#36964) 2020-06-21 00:39:08 +02:00
Fredrik Erlandsson 9f65dcf4ba
Fix unique_id in Zeroconf flow (#36948) 2020-06-20 22:59:25 +02:00
Davide Varricchio 13c0a59e28
Bump pyaehw4a1 to v.0.3.5 (#36949) 2020-06-20 19:14:27 +02:00
Bram Kragten 7d69b90eac
Update frontend to 20200620.0 and add redirects (#36953) 2020-06-20 19:05:22 +02:00
Franck Nijhof 60dd94d5b0
Upgrade ptvsd to 4.3.2 (#36950) 2020-06-20 14:25:02 +02:00
avocadio 2196bd66c7
Add TTS support to Heos (#35386)
* TTS seems unsupported on heos media player #32862 

TTS seems unsupported on heos media player #32862 

The type media_type music which is required by TTS was not covered.

* Update homeassistant/components/heos/media_player.py

Co-authored-by: Andrew Sayre <6730289+andrewsayre@users.noreply.github.com>

* Update to test_media_player.py

Test for TTS support to Heos #35386

* Update test

Add TTS support to Heos #35386

* Update to test_play_media_music

assert set to "Unable to play music: Failure (1)" seems to cause an issue.

* test_play_media_music

syntax

Co-authored-by: Andrew Sayre <6730289+andrewsayre@users.noreply.github.com>
2020-06-20 09:54:44 +02:00
Paulus Schoutsen 8895f9b70a
Remove unused webhook dependency from device automation (#36946) 2020-06-20 09:11:17 +02:00
Kit Klein a074cf4afd
Use chip id in Konnected pro boards (#36940)
* use chip id in pro boards

* cleaner failover
2020-06-20 08:39:04 +02:00
ehendrix23 2fd6431cff
Allow harmony activity change on start of switching activity (#36699)
* Allow activity change on start of switch

Allow activity to be updated when a switch to a new activity is initiated instead of when it is completed.

* Updates based on feedback

Some items are not required to be done as YAML is not used anymore.
Cleaned-up some code.

* Fix for change on how to set callbacks

How callbacks are set now one has to set the new_activity and new_activity_starting as well, even just with None.

* Added callback update

Added so that when it is changed in the UI the callbacks will be changed as well.

* Added test cases for notify setting

Added test cases for config flow to test new setting for activity notifications.
2020-06-19 21:50:42 -05:00
Paulus Schoutsen 5642027ffb
Improve after_dependencies handling (#36898) 2020-06-19 17:24:33 -07:00
HomeAssistant Azure 93272e3083 [ci skip] Translation update 2020-06-20 00:09:26 +00:00
J. Nick Koston 2b5e7c2611
Fix recorder stopping after unserializable state (#36937)
* Ensure unserializable states do not collapse recording

* augment test coverage

* fix wal mode being set every time
2020-06-19 12:03:06 -05:00
Franck Nijhof 683d960fa5
Add discovery to NUT integration (#36827)
* Add discovery to NUT integration

* implement async_step_zeroconf

* Update test to make sure unique id not set

* Remove host/port import when coming from discovery, add title placeholders

* fix mis-paste

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-06-19 17:33:01 +02:00
jjlawren d445c16697
Handle Plex Live TV sessions (#36919) 2020-06-19 17:12:47 +02:00
Markus Bong e4df0481da
Fix devolo brand name (#36865) 2020-06-19 17:04:31 +02:00
jjlawren 3d1a5f76b2
Fix cert_expiry time-based tests v2 (#36934) 2020-06-19 16:19:43 +02:00
Paulus Schoutsen 263bdaa565
Make panel_custom backwards compatible (#36926) 2020-06-19 16:03:39 +02:00
craiggenner 212660330f
Cope with attribute errors being converted (#36911) 2020-06-19 05:36:56 +02:00
HomeAssistant Azure f83d4e524b [ci skip] Translation update 2020-06-19 00:10:18 +00:00
jjlawren 6bffd9a892
Fix cert_expiry time-based tests (#36924) 2020-06-19 00:26:34 +02:00
Robert Svensson 02e03340df
Light control support to Axis devices (#36611)
* IR light support to Axis devices

* Change how to read light state

* Add tests

* Bump dependency to v32

* Assert variables passed to set_intensity
2020-06-18 23:27:08 +02:00
jjlawren e92e26b73a
Add expiration timestamp to cert_expiry sensors (#36399)
* Add expiration timestamp to cert_expiry sensors

* Clear timestamp if cert becomes invalid

* Use timezone-aware timestamps

* Use DataUpdateCoordinator, split timestamp to separate sensor

* Use UTC, simpler add/remove handling

* Review fixes

* Fix incomplete mock that fails in 3.8

* Use static timestamps, improve helper method name
2020-06-18 18:29:46 +02:00
Paulus Schoutsen f69fc79fd1
Bump Netdisco to 2.7.1 (#36891) 2020-06-18 13:08:43 +02:00
J. Nick Koston e7d982ee11
Improve db performance of state change events and reduce overall db size (#36883)
* Add old_state_id to states, remove old/new state data from events since it can now be found by a join

* remove state lookup on restart

* Ensure old_state is set for exisitng states
2020-06-17 22:26:41 -05:00
Paulus Schoutsen 94132e5572
Add internal/external url to safe mode (#36894) 2020-06-17 17:14:48 -07:00
HomeAssistant Azure 7920c5e5e8 [ci skip] Translation update 2020-06-18 00:08:13 +00:00
Paulus Schoutsen df59f87f34
Upgrade requests to 2.24.0 (#36886) 2020-06-17 16:26:29 -07:00
Paulus Schoutsen c0a2e6b655
Merge pull request #36885 from home-assistant/rc 2020-06-17 16:23:37 -07:00
Paulus Schoutsen b4b2302e04 Fix test 2020-06-17 16:23:10 -07:00