Commit Graph

8531 Commits (1a68784852472c85a5fbb3ae7001283bd7a43b23)

Author SHA1 Message Date
Erik Montnemery 8c3fc95fb8
Fallback to state machine in statistics (#56785) 2021-09-29 14:57:16 -07:00
Robert Svensson f224ab6d67
Use isinstance to verify class in deCONZ integration (#56794)
* Don't enable any variants of the daylight sensor entities by default

* Use isinstance rather than doing ZHATYPE compare

* Accidentally removed an import
2021-09-29 21:19:21 +02:00
jjlawren 8f4ba564d4
Plex media browser improvements (#56312) 2021-09-29 11:17:55 -07:00
Alexei Chetroi dbba2c4afe
Add "Summation Delivered" Sensor for SmartEnergy metering ZHA channel (#56666) 2021-09-29 09:35:20 -07:00
Daniel Hjelseth Høyer 60eb426451
Add Surepetcare locks (#56396)
* Surepetcare, add lock

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Fix tests

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Surepetcare, lock name

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* surepetcare_id

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* typing

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Fix review comment

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Fix review comment

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Fix review comment

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* add more tests

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Fix review comment

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>
2021-09-29 09:17:12 -07:00
Martin Hjelmare 50fffe48f8
Add zwave to zwave_js migration (#56159)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-09-29 08:55:27 -07:00
Daniel Hjelseth Høyer d5c3d234ec
Open garage, add config flow (#55290) 2021-09-29 09:43:51 -06:00
Erik Montnemery 40ecf22bac
Remove automatic splitting of net meters from statistics (#56772) 2021-09-29 17:20:17 +02:00
Erik Montnemery 00651a4055
Optimize _get_states_with_session (#56734)
* Optimize _get_states_with_session

* Move custom filters to derived table

* Remove useless derived table

* Filter old states after grouping

* Split query

* Add comments

* Simplify state update period criteria

* Only apply custom filters if we didn't get an include list of entities

Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-29 17:08:27 +02:00
avee87 daebc34f4d
Add code_format to template alarm (#56700)
* Added code_format to template alarm

* review comment

* review comment

* use constant

* back to enum

* none -> no_code
2021-09-29 16:59:46 +02:00
Franck Nijhof 41e5f05d99
Fix energy validation when not tracking costs (#56768) 2021-09-29 13:24:34 +02:00
Joakim Sørensen 6a9b484f2d
Remove timeout for backup services (#56763) 2021-09-29 09:46:05 +02:00
Regev Brody 115bb39c10
Fix cover group to handle unknown state properly (#56739)
* fix cover group unknown state

* fix cover grup state

* fix cover group issue
2021-09-29 08:37:16 +02:00
João Pedro Hickmann 4513a46248
Add zeroconf support for yeelight (#56758) 2021-09-28 20:53:43 -05:00
Myles Eftos 8e91e6e97e
Adding price spike binary sensor to the Amber electric integration (#56736) 2021-09-28 18:01:35 -07:00
J. Nick Koston cf36d0966d
Add coverage to verify tplink unique ids (#56746) 2021-09-28 17:57:22 -07:00
Michael Chisholm f7d95588f8
Provide most media metadata in DlnaDmrEntity (#56728)
Co-authored-by: Steven Looman <steven.looman@gmail.com>
2021-09-28 19:37:23 -05:00
Raman Gupta e76ddb4b27
Add proper S2 support for adding zwave_js nodes (#56516)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-09-28 15:37:45 -07:00
J. Nick Koston bc59387437
Explictly close the TPLink SmartDevice protocol on unload (#56743)
* Explictly close the TPLink SmartDevice protocol on unload

- There is a destructor that will eventually do this when
  the object gets gc. Its better to explictly do it at
  unload.

* fix coro mock
2021-09-28 18:36:45 +02:00
J. Nick Koston c95f7a5ba6
Add network support to tplink for discovery across subnets (#56721) 2021-09-28 09:58:25 -05:00
jjlawren 0d6aa89fd4
Refactor Sonos alarms and favorites updating (#55529) 2021-09-28 09:49:32 +02:00
Diogo Gomes 922d4c42a3
Inherit Filter sensor state_class from source sensor (#56407) 2021-09-28 09:30:21 +02:00
Raman Gupta e690d4b006
Add support for zwave_js device actions (#53038)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-09-28 09:06:02 +02:00
Myles Eftos 412ecacca3
Amberelectric (#56448)
* Add Amber Electric integration

* Linting

* Fixing some type hinting

* Adding docstrings

* Removing files that shouldn't have been changed

* Splitting out test helpers

* Testing the price sensor

* Testing Controlled load and feed in channels

* Refactoring mocks

* switching state for native_value and unit_of_measurement for native_unit_of_measurement

* Fixing docstrings

* Fixing requiremennts_all.txt

* isort fixes

* Fixing pylint errors

* Omitting __init__.py from test coverage

* Add missing config_flow tests

* Adding more sensor tests

* Applying suggested changes to __init.py__

* Refactor coordinator to return the data object with all of the relevent data already setup

* Another coordinator refactor - Better use the dictionary for when we build the sensors

* Removing first function

* Refactoring sensor files to use entity descriptions, remove factory

* Rounding renewable percentage, return icons correctly

* Cleaning up translation strings

* Fixing relative path, removing TODO

* Coordintator tests now accept new (more accurate) fixtures

* Using a description placeholder

* Putting missing translations strings back in

* tighten up the no site error logic - self._site_id should never be None at the point of loading async_step_site

* Removing DEVICE_CLASS, replacing the units with AUD/kWh

* Settings _attr_unique_id

* Removing icon function (it's already the default)

* Apply suggestions from code review

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Adding strings.json

* Tighter wrapping for try/except

* Generating translations

* Removing update_method - not needed as it's being overriden

* Apply suggestions from code review

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Fixing tests

* Add missing description placeholder

* Fix warning

* changing name from update to update_data to match async_update_data

* renaming [async_]update_data => [async_]update_price_data to avoid confusion

* Creating too man renewable sensors

* Override update method

* Coordinator tests use _async_update_data

* Using $/kWh as the units

* Using isinstance instead of __class__ test. Removing a zero len check

* Asserting self._sites in second step

* Linting

* Remove useless tests

Co-authored-by: jan iversen <jancasacondor@gmail.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-09-28 00:03:51 -07:00
J. Nick Koston f93539ef4c
Add api to the network integration to get ipv4 broadcast addresses (#56722) 2021-09-27 21:43:39 -07:00
Erik Montnemery 8ef123259e
Add WS API for updating unit_of_measurement in statistics metadata (#56184)
* Add WS API for updating statistics metadata

* Update homeassistant/components/recorder/websocket_api.py

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

* Update homeassistant/components/recorder/websocket_api.py

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Fix typo

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-09-28 00:43:29 +02:00
Diogo Gomes ec9fc0052d
Define `unit_of_measurement` of all `utility_meter` sensors on HA start (#56112)
* define unit_of_measurement on hass start

* delay utility_meter state

* check state

* store siblings

* don't check unit_of_measurement
2021-09-28 00:42:27 +02:00
Erik Montnemery 5976f898da
Add WS API for removing statistics for a list of statistic_ids (#55078)
* Add WS API for removing statistics for a list of statistic_ids

* Refactor according to code review, enable foreign keys support for sqlite

* Adjust tests

* Move clear_statistics WS API to recorder

* Adjust tests after rebase

* Update docstring

* Update homeassistant/components/recorder/websocket_api.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Adjust tests after rebase

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-09-27 23:30:13 +02:00
Michael Chisholm a28fd7d61b
Config-flow for DLNA-DMR integration (#55267)
* Modernize dlna_dmr component: configflow, test, types

* Support config-flow with ssdp discovery
* Add unit tests
* Enforce strict typing
* Gracefully handle network devices (dis)appearing

* Fix Aiohttp mock response headers type to match actual response class

* Fixes from code review

* Fixes from code review

* Import device config in flow if unavailable at hass start

* Support SSDP advertisements

* Ignore bad BOOTID, fix ssdp:byebye handling

* Only listen for events on interface connected to device

* Release all listeners when entities are removed

* Warn about deprecated dlna_dmr configuration

* Use sublogger for dlna_dmr.config_flow for easier filtering

* Tests for dlna_dmr.data module

* Rewrite DMR tests for HA style

* Fix DMR strings: "Digital Media *Renderer*"

* Update DMR entity state and device info when changed

* Replace deprecated async_upnp_client State with TransportState

* supported_features are dynamic, based on current device state

* Cleanup fully when subscription fails

* Log warnings when device connection fails unexpectedly

* Set PARALLEL_UPDATES to unlimited

* Fix spelling

* Fixes from code review

* Simplify has & can checks to just can, which includes has

* Treat transitioning state as playing (not idle) to reduce UI jerking

* Test if device is usable

* Handle ssdp:update messages properly

* Fix _remove_ssdp_callbacks being shared by all DlnaDmrEntity instances

* Fix tests for transitioning state

* Mock DmrDevice.is_profile_device (added to support embedded devices)

* Use ST & NT SSDP headers to find DMR devices, not deviceType

The deviceType is extracted from the device's description XML, and will not
be what we want when dealing with embedded devices.

* Use UDN from SSDP headers, not device description, as unique_id

The SSDP headers have the UDN of the embedded device that we're interested
in, whereas the device description (`ATTR_UPNP_UDN`) field will always be
for the root device.

* Fix DMR string English localization

* Test config flow with UDN from SSDP headers

* Bump async-upnp-client==0.22.1, fix flake8 error

* fix test for remapping

* DMR HA Device connections based on root and embedded UDN

* DmrDevice's UpnpDevice is now named profile_device

* Use device type from SSDP headers, not device description

* Mark dlna_dmr constants as Final

* Use embedded device UDN and type for unique ID when connected via URL

* More informative connection error messages

* Also match SSDP messages on NT headers

The NT header is to ssdp:alive messages what ST is to M-SEARCH responses.

* Bump async-upnp-client==0.22.2

* fix merge

* Bump async-upnp-client==0.22.3

Co-authored-by: Steven Looman <steven.looman@gmail.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-27 15:47:01 -05:00
RenierM26 b15f11f46a
Discover Switchbot MAC in config flow (#56616)
* Update config_flow.py

* Switchbot Config_flow discover mac instead of needing to type it.

* Do not show already configured devices in config flow, abort if no unconfigured devices.

* Apply suggestions from code review

Co-authored-by: J. Nick Koston <nick@koston.org>

* Move MAC to top of config flow form dict.

* Update homeassistant/components/switchbot/config_flow.py

Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-27 15:12:40 -05:00
Teemu R b40d229369
Rework TPLink integration to use python-kasa (#56701)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Teemu R. <tpr@iki.fi>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-09-27 14:11:55 -05:00
Raman Gupta f0e0b41f77
Use entity attributes for vizio integration (#56093) 2021-09-27 20:20:15 +02:00
Erik Montnemery 4d7e3cde5a
Minor cleanup and test coverage improvement for MQTT (#55265) 2021-09-27 17:45:52 +02:00
Michael Chisholm 805e73f78c
Add UPNP device connection for Sonos (#56702) 2021-09-27 17:36:47 +02:00
Marius 4ce7166afd
Add node sensor status icons (#56137)
Co-authored-by: kpine <keith.pine@gmail.com>
Co-authored-by: Raman Gupta <7243222+raman325@users.noreply.github.com>
2021-09-27 12:50:14 +02:00
Erik Montnemery 58f465f271
Don't reset meter when last_reset is set to None (#56609) 2021-09-27 12:17:09 +02:00
Robert Svensson ca6b53c16d
Remove UniFi config entry reference from device when removing last entity of said device (#56501) 2021-09-27 12:04:29 +02:00
Michael Chisholm 6c2674734a
SSDP starts config flow only for alive devices (#56551)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-27 08:39:22 +02:00
Raman Gupta 8716aa011a
Add support for multilevel switch CC select entities (#56656)
* Add support for multilevel switch CC select entities

* Use state names from docs and include more device identifiers from device DB

* black

* pylint

* type fix

* Add failure scenario test

* Update homeassistant/components/zwave_js/select.py

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-09-26 14:22:41 -04:00
J. Nick Koston 52410ff0d7
Ensure yeelight can be unloaded when device is offline (#56464) 2021-09-26 09:54:43 -07:00
J. Nick Koston 26f73779cc
Avoid enabling ipv6 dual stack for zeroconf on unsupported platforms (#56584) 2021-09-26 09:51:34 -07:00
Daniel Hjelseth Høyer f0de6dc21a
Use SurePetcareEntity for surepetcare binary sensor (#56601)
* Use SurePetcareEntity for surepetcare binary sensor

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* tests

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>
2021-09-25 11:17:55 +02:00
Raman Gupta b1f4ccfd6b
Reuse zwave_js device when replacing removed node with same node (#56599)
* Reuse zwave_js device when a removed node is replaced with the same node

* Ensure change is backwards compatible with servers that don't include replaced

* Remove lambda

* Add assertions to remove type ignores

* fix tests by always copying state and setting manufacturer/label attributes
2021-09-25 10:43:37 +02:00
Michaël Arnauts 5d3d6fa1cd
Add `state_class` and use `SensorEntityDescription` for comfoconnect (#54066)
* Add state_class=measurement and use SensorEntityDescriptions

* Use attributes from entity_description

* Improvements

* Adress remarks

* Revert changes to fan

* move method

* Fix tests

* Revert fan/__init__.py

* Revert key change

* Set default percentage in turn_on
2021-09-24 22:26:56 +02:00
Aaron Bach 0ea5f25594
Add ability to re-auth Notion (#55616) 2021-09-24 11:23:19 -07:00
Robert Hillis e078f4ce14
Move efergy api to pyefergy (#56594)
* Move efergy api to pyefergy

* fix permissions

* tweak

* tweak
2021-09-24 12:54:15 +02:00
Erik Montnemery 64393b462d
Add migration for 5-minute statistics (#56585)
* Add migration for 5-minute statistics

* Tweaks
2021-09-24 09:19:22 +02:00
Erik Montnemery 7452998081
Convert last_reset timestamps to UTC (#56561)
* Convert last_reset timestamps to UTC

* Add test

* Apply suggestion from code review
2021-09-24 09:16:50 +02:00
Jan Bouwhuis e73ca9bd18
Alexa fix Fan support and cleanup (#56053)
* del PowerLevelController, ena fan PowerController

* Use AlexaRangeContoller for speed or default

* Update tests

* no-else-return

* Avoid cases with only one preset_mode

* Only report ghost_mode to Alexa - fix bug

* Add some tests for patched code

* pylint

* pylint and tests with one preset_mode

* correct ghost preset mode check in test

* add tests for RangeController

* ghost preset_mode locale agnostic

* isort

* Update homeassistant/components/alexa/capabilities.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update homeassistant/components/alexa/entities.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update homeassistant/components/alexa/entities.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update homeassistant/components/alexa/entities.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update homeassistant/components/alexa/entities.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update entities.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-09-24 08:14:45 +02:00
J. Nick Koston 0363c22dd8
Fix Sonos going offline with 13.3 firmware (#56590) 2021-09-23 20:39:20 -07:00
Milan Meulemans 0b53f73fe2
Convert Nanoleaf integration to use Async library aionanoleaf (#56548) 2021-09-23 15:37:37 -05:00
Michael 7ece35cd6f
Assume Fritz!Smarthome device as unavailable (#56542) 2021-09-23 13:29:12 -07:00
Daniel Hjelseth Høyer 6e7bc65e2e
Airthings (#56578) 2021-09-23 13:20:30 -07:00
Daniel Hjelseth Høyer a94514b00d
Add Surepetcare entity class (#56430) 2021-09-23 13:19:46 -07:00
Rami Mosleh 4c40d1767a
Remove config for `Speedtest.net` (#55642) 2021-09-23 20:44:59 +02:00
Ricardo Steijn 63610eadc9
Address Crownstone review comments (#56485) 2021-09-23 09:23:45 +02:00
Erik Montnemery 83156fb9ec
Energy validation: Require last_reset attribute to be set for state_class measurement energy and cost sensors (#56254)
* Require last_reset attribute to be set for measurement state_class

* Tweak

* Improve tests

* Lint

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-09-22 21:48:37 -07:00
Paulus Schoutsen 677abcd484
Allow confirming local push notifications (#54947)
* Allow confirming local push notifications

* Fix from Zac

* Add tests
2021-09-22 23:17:04 +02:00
Erik Montnemery f77e93ceeb
Fix validation of cost entities for energy dashboard (#56219) 2021-09-22 13:57:58 -07:00
Erik Montnemery 92253f5192
Minor refactoring of periodic statistics (#56492) 2021-09-22 13:31:33 -07:00
Ville Skyttä d8d34fdd3b
Prefer HTTPStatus over int in HA view JSON functions (#56504)
* Prefer HTTPStatus over int in HA view JSON functions

* Update zwave tests to not expect a fixed typo
2021-09-22 21:59:52 +03:00
Paulus Schoutsen 39aaa383b3
Fix flaky srp energy test (#56536) 2021-09-22 17:41:10 +02:00
Alexei Chetroi a5d405700c
ZHA channel ZCL attributes initialization (#56476)
* Add dict of attributes to initialize

* Refactor get_attributes() method

Read 5 attributes at the time.

* Add ZCL_INIT_ATTRS attribute to base Zigbee channel

* Update tests and general clusters

* Update channels to use ZCL_INIT_ATTRS

* Update channels to use ZCL_INIT_ATTRS

* Fix tests

* Refactor async_initialize() to be a retryable request

* Maky pylint happy again
2021-09-22 11:34:30 -04:00
Paulus Schoutsen e34c985534
Simplify cloud request connection handling (#56243)
Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2021-09-22 07:51:31 -07:00
Erik Montnemery ac053388b4
Convert image_processing tests to pytest (#56451)
* Convert image_processing tests to pytest

* Use existing fixtures and test helpers

* Remove useless code
2021-09-22 15:00:28 +02:00
Tobias Sauerwein 26d310fc8a
Split Netatmo camera persons by home (#55598)
* Split persons by home
* Bump pyatmo to 6.0.0
* Check is person exists
* Extract method for fetching person ids
2021-09-22 14:32:30 +02:00
Niklas Åström 783cc1eacd
Optimise requests to the tado servers (#56261)
This avoids calling the tado servers unnecessarily many times, especially for bigger homes. This is done by calling aggregating endpoints instead of iterating over the zones and devices and calling endpoints over and over.
2021-09-22 14:01:30 +02:00
Erik Montnemery d494b3539d
Prevent 3rd party lib from opening sockets in google_assistant tests (#56346) 2021-09-21 11:27:10 -07:00
Ville Skyttä 1aa7c87151
Remove redundant aiohttp response status=200 kwargs (#56417)
* Remove redundant aiohttp response status=200 kwargs

* Remove some more in h.c.auth

* Restore explicit status=HTTP_OK for auth and webhook per review request
2021-09-21 10:51:12 -07:00
RenierM26 26e9590927
Add cover platform to switchbot (#56414)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-21 12:35:47 -05:00
Elliot Morales Solé 097fae0348
Correct Alexa scene activation (#56469)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-09-20 22:51:17 -07:00
Paulus Schoutsen d4864f5750
Deprecate passing template to notify (#56069) 2021-09-20 21:49:02 -07:00
Aaron Bach aabc8cd2d5
Add WattTime integration (#56149) 2021-09-20 21:10:24 -07:00
Paulus Schoutsen 9059ee6604
Merge pull request #56472 from home-assistant/shelly-gen2 2021-09-20 20:19:19 -07:00
Shay Levy 47340802b3
Add Shelly RPC device trigger and logbook platforms (#56428)
* Add RPC device trigger and logbook platforms

* Single input event for Block and RPC

* Add device generation to shelly.click
2021-09-21 00:09:44 +03:00
J. Nick Koston 9e2a29dc37
Improve yeelight stability by moving timeout handling to upstream library (#56432) 2021-09-20 12:32:01 -05:00
Erik Montnemery 6f36419c6f
Improve statistics validation (#56457) 2021-09-20 17:54:25 +02:00
Erik Montnemery fc4bb40a63
Prevent opening sockets in panasonic_viera tests (#56441) 2021-09-20 15:01:49 +02:00
Erik Montnemery 5c717cbb1d
Prevent opening of sockets in onboarding tests (#56443) 2021-09-20 13:56:50 +02:00
Otto Winter a54854d129
ESPHome Noise Transport Encryption support (#56216) 2021-09-20 09:02:17 +02:00
Milan Meulemans d76163e5be
Add tests for Rituals Perfume Genie number, select and binary_sensor platforms (#55224) 2021-09-19 08:51:57 -10:00
J. Nick Koston 88e42a540e
Remove leftover debug prints in tests (#56409) 2021-09-19 12:43:02 +02:00
Erik Montnemery ec52763706
Prevent 3rd party lib from opening sockets in samsungtv tests (#56334) 2021-09-18 22:24:27 -10:00
Erik Montnemery 80a57f5118
Prevent 3rd party lib from opening sockets in smhi tests (#56335) 2021-09-19 10:18:45 +02:00
Erik Montnemery f6526de7b6
Use hass_client_no_auth test fixture in nest tests (#56326) 2021-09-18 23:17:09 +02:00
Erik Montnemery 43b5dcff76
Use hass_client_no_auth test fixture in withings tests (#56337) 2021-09-18 23:12:02 +02:00
Robert Svensson bf7c2753d5
deCONZ use siren platform (#56397)
* Add siren.py

* Working siren platform with 100% test coverage

* Also add test file...

* Add test to verify that switch platform cleans up legacy entities now that sirens are their own platform

* Update homeassistant/components/deconz/siren.py

Co-authored-by: jjlawren <jjlawren@users.noreply.github.com>
2021-09-18 21:59:04 +02:00
RenierM26 3ce8109e5e
Add config flow to Switchbot (#50653)
Co-authored-by: Daniel Hjelseth Høyer <mail@dahoiv.net>
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-18 09:25:05 -10:00
jjlawren f31b9eae61
Fix creating `cert_expiry` configs during runtime (#56298)
* Fix creating cert_expiry configs during runtime

* Address review feedback on tests

* Improve delayed startup test
2021-09-18 19:54:54 +02:00
Erik Montnemery 39bc127dd6
Prevent 3rd party lib from opening sockets in glances tests (#56345) 2021-09-17 22:22:44 -10:00
Erik Montnemery be0819b456
Mock out network.util.async_get_source_ip in tests (#56339) 2021-09-17 21:40:58 -10:00
J. Nick Koston 0830100df1
Do not reload the isy994 on ip change since there is already a reload listener (#54602) 2021-09-17 21:22:14 -10:00
Robert Svensson 539ef31046
Reflect changes to pydeconz v84 (#56361)
Mostly snake case conversions and typing
But also a change in retry mechanism
Added a more complete set_* call to most types to remove the direct relation to rest API of deCONZ
2021-09-18 09:05:08 +02:00
jan iversen 6947912fa9
Modbus entity update does not occur until after scan_interval (#56221)
* Secure update is called when integration is started.

* Review comments.

* Update homeassistant/components/modbus/base_platform.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/modbus/base_platform.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-09-18 08:57:27 +02:00
J. Nick Koston 7524daad86
Fix HomeKit requests with hvac mode and temperature in the same call (#56239) 2021-09-17 22:47:06 -07:00
J. Nick Koston bad6b2f7f5
Standardize yeelight exception handling (#56362) 2021-09-17 22:25:19 -07:00
jan iversen c4195c547c
Update template/test_init.py to use pytest (#56336) 2021-09-17 15:13:17 -07:00
Alexei Chetroi 5b0e00a74b
Refactor ZHA HVAC thermostat channel (#56238)
* Refactor HVAC channel to use zigpy cached attributes

* Allow named attributes in ZHA test attribute reports

* Let attribute write to update cache

* WIP Update tests

* Cleanup
2021-09-17 15:17:34 -04:00
Erik Montnemery 45046941c6
Avoid creating sockets in homekit port available tests (#56342) 2021-09-17 04:16:57 -10:00
Joakim Plate 9b00e0cb7a
Rfxtrx device triggers and actions (#47909)
* Add helper

* Add device actions

* Add trigger

* Just make use of standard command

* Generalize code a bit

* Switch tests to currently existing features

* Add tests for capabilities

* Don't check schema asserted value

* Adjust strings somewhat

* Directly expose action subtypes

* Add a status event test

* Switch to modern typing

* Drop chime that is now part of command

* Adjust strings a bit

* Drop ability to set custom value

* Adjust changed base schema

* Validate triggers

* Try fix typing for 3.8
2021-09-17 15:28:43 +02:00
Erik Montnemery ecf4a7813a
Prevent 3rd party lib from opening sockets in wilight tests (#56310) 2021-09-17 15:27:26 +02:00
Erik Montnemery 797b68b42d
Prevent 3rd party lib from opening sockets in rfxtrx tests (#56331) 2021-09-17 12:51:40 +02:00
Erik Montnemery 55a77b2ba2
Prevent 3rd party lib from opening sockets in ps4 tests (#56330) 2021-09-17 12:51:25 +02:00
Erik Montnemery 327bf24940
Prevent 3rd party lib from opening sockets in cloud tests (#56328) 2021-09-17 12:50:59 +02:00
Erik Montnemery e0a232aa36
Prevent 3rd party lib from opening sockets in wallbox tests (#56308) 2021-09-17 12:50:11 +02:00
Erik Montnemery a793fd4134
Prevent 3rd party lib from opening sockets in ping tests (#56329) 2021-09-16 23:41:19 -10:00
Erik Montnemery bce4c5eb11
Prevent 3rd party lib from opening sockets in zeroconf tests (#56324) 2021-09-16 23:19:32 -10:00
Erik Montnemery fce7f0873e
Prevent 3rd party lib from opening sockets in sia tests (#56325) 2021-09-16 23:19:19 -10:00
Erik Montnemery 8341ae12d3
Mock out zeroconf in homekit_controller tests (#56307) 2021-09-16 11:29:41 -10:00
jan iversen 70eb519f76
Update template/test_light.py to use pytest (#56300) 2021-09-16 11:05:00 -07:00
Shay Levy 8418d4ade2
Address Switcher late review comments (#56264)
* Address Switcher late review comments

* Rename wrapper to coordinator
2021-09-16 17:06:58 +02:00
jjlawren 0438c9308c
Delay startup for `cert_expiry` to allow for self checks (#56266)
* Delay startup of cert_expiry

* Update tests
2021-09-16 13:31:36 +02:00
Erik Montnemery 8c5efafdd8
Add 5-minute statistics for sensors (#56006)
* Add 5-minute statistics for sensors

* Address pylint issues

* Black

* Apply suggestion from code review

* Apply suggestions from code review

* Improve tests
2021-09-16 10:57:15 +02:00
Malachi Soord 0656407561
Upgrade pylast from 4.2.0 to 4.2.1 (#56015)
* Upgrade pylast from 4.2.0 to 4.2.1

* Fix test

* Use MockNetwork

* Tidy

* Fix lint
2021-09-16 07:00:25 +02:00
muppet3000 19054e1ffe
Bump growattServer to 1.1.0 (#56084) 2021-09-15 10:08:15 +02:00
epenet 0d842a8f01
Adjust charging_power unit (#56167) 2021-09-15 07:54:56 +02:00
jan iversen 692f611109
Update template/test_fan.py to use pytest (#56215) 2021-09-14 13:51:46 -07:00
jan iversen 96a9af8cc4
Update template/test_weather.py to use pytest (#56223) 2021-09-14 13:06:55 -07:00
jan iversen 4b2ff0a0ba
Update template/alarm_control_panel.py to use pytest (#56229) 2021-09-14 13:06:29 -07:00
Ricardo Steijn 2a51bb5bba
Add Crownstone integration (#50677) 2021-09-14 09:46:52 -10:00
Erik Montnemery bac55b78fe
Enforce device class for gas and energy sensors used by energy dashboard (#56218)
* Enforce device class for gas and energy sensors used by energy dashboard

* Adjust tests
2021-09-14 16:56:36 +02:00
jan iversen aaa62dadec
Add service to stop/restart modbus (#55599)
* Add service to stop/restart modbus.

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-09-14 09:42:50 +02:00
Robert Hillis 14aa9c91eb
Add Config Flow to Modem Caller ID integration (#46677)
* Add phone_modem integration

* Use original domain

* Add init tests for Modem Caller ID

* Clean up tests

* Clean up tests

* apply suggestions

* Fix tests

* Make only one instance possible

* Allow more than 1 device and remove hangup service

* simplify already configured

* Update sensor.py

* Update config_flow.py

* Fix manifest

* More cleanup

* Fix tests

* Ue target

* Clean up sensor.py

* Minor tweaks

* Close modem on restart and unload

* Update requirements

* fix tests

* Bump phone_modem

* rework

* add typing

* use async_setup_platform

* typing

* tweak

* cleanup

* fix init

* preserve original name

* remove callback line

* use list of serial devices on host

* tweak

* rework

* Rework for usb dicsovery

* Update requirements_test_all.txt

* Update config_flow.py

* tweaks

* tweak

* move api out of try statement

* suggested tweaks

* clean up

* typing

* tweak

* tweak

* async name the service
2021-09-13 14:22:54 -10:00
Brian Egge 8d87f4148b
Fix generic thermostat switch state initialization (#56073) 2021-09-13 22:27:06 +02:00
Abílio Costa c869b78ac1
Add Whirlpool integration (#48346)
* Add Whirlpool integration

* Apply suggestions from code review

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Apply suggestions from code review

* Fix lint

* Fix lint and tests

* Apply suggestions from code review

Co-authored-by: J. Nick Koston <nick@koston.org>

* Use dict lookups

* Lint

* Apply code changes from PR review

* Do real integration setup in tests

* Apply suggestions from review & fix test

* Replace get with array operator

* Add suggestions from code review

* Rename test var

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-13 10:02:34 -10:00
Daniel Hjelseth Høyer f9de8fb49a
Surepetcare config flow (#56127)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-13 09:57:06 -10:00
starkillerOG 5f86388f1c
Netgear config flow (#54479)
* Original work from Quentame

* Small adjustments

* Add properties and method_version

* fix unknown name

* add consider_home functionality

* fix typo

* fix key

* swao setup order

* use formatted mac

* add tracked_list option

* add options flow

* add config flow

* add config flow

* clean up registries

* only remove if no other integration has that device

* tracked_list formatting

* convert tracked list

* add import

* move imports

* use new tracked list on update

* use update_device instead of remove

* add strings

* initialize already known devices

* Update router.py

* Update router.py

* Update router.py

* small fixes

* styling

* fix typing

* fix spelling

* Update router.py

* get model of router

* add router device info

* fix api

* add listeners

* update router device info

* remove method version option

* Update __init__.py

* fix styling

* ignore typing

* remove typing

* fix mypy config

* Update mypy.ini

* add options flow tests

* Update .coveragerc

* fix styling

* Update homeassistant/components/netgear/__init__.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netgear/__init__.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netgear/__init__.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netgear/config_flow.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netgear/router.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* add ConfigEntryNotReady

* Update router.py

* use entry.async_on_unload

* Update homeassistant/components/netgear/device_tracker.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* use cv.ensure_list_csv

* add hostname property

* Update device_tracker.py

* fix typo

* fix isort

* add myself to codeowners

* clean config flow

* further clean config flow

* deprecate old netgear discovery

* split out _async_remove_untracked_registries

* Update homeassistant/components/netgear/config_flow.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netgear/config_flow.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* cleanup

* fix rename

* fix typo

* remove URL option

* fixes

* add sensor platform

* fixes

* fix removing multiple entities

* remove extra attributes

* initialize sensors correctly

* extra sensors disabled by default

* fix styling and unused imports

* fix tests

* Update .coveragerc

* fix requirements

* remove tracked list

* remove tracked registry editing

* fix styling

* fix discovery test

* simplify unload

* Update homeassistant/components/netgear/router.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* add typing

Co-authored-by: J. Nick Koston <nick@koston.org>

* add typing

Co-authored-by: J. Nick Koston <nick@koston.org>

* add typing

Co-authored-by: J. Nick Koston <nick@koston.org>

* condense NetgearSensorEntities

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netgear/router.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netgear/router.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netgear/router.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netgear/router.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* add typing

* styling

* add typing

* use ForwardRefrence for typing

* Update homeassistant/components/netgear/device_tracker.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* add typing

* Apply suggestions from code review

Thanks!

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

* process review comments

* fix styling

* fix devicename not available on all models

* ensure DeviceName is not needed

* Update homeassistant/components/netgear/config_flow.py

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

* Update homeassistant/components/netgear/config_flow.py

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

* Update __init__.py

* fix styling

Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-09-13 18:18:21 +02:00
Brian Egge e638e5bb42
Add component for binary sensor groups (#55365)
* Add component for binary sensor groups
https://github.com/home-assistant/home-assistant.io/pull/19239

* Accidental push over prior commit

* Add test for any case

* Add unavailable attribute and tests for unique_id

* Added tests for attributes

link to documentation: https://github.com/home-assistant/home-assistant.io/pull/19297
2021-09-13 15:28:37 +02:00
Erik Montnemery d899d15a1e
Add statistics validation (#56020)
* Add statistics validation

* Remove redundant None-check

* Move validate_statistics WS API to recorder

* Apply suggestion from code review
2021-09-13 13:44:22 +02:00
Erik Montnemery d2a9f7904a
Include end time of statistics data points in API response (#56063)
* Include end time of statistics data points in API response

* Correct typing

* Update tests
2021-09-13 10:02:24 +02:00
Shay Levy e9eb76c7db
Add switch support for RPC device (#56153)
* Add switch support for RPC device

* Apply review comments

* Apply review comments
2021-09-13 09:31:35 +03:00
Maikel Punie 7472fb2049
Switch velbus from python-velbus to velbusaio (#54032)
* initial commit

* use new release

* Update for sensors

* big update

* pylint fixes, bump dependancy to 2021.8.2

* New version to try to fix the tests

* Fix a lot of errors, bump version

* more work

* Bump version

* Adde dimmer support

* Make sure the counters are useable in the energy dashboard

* bump version

* Fix testcases

* Update after review

* Bump version to be able to have some decent exception catches, add the temperature device class

* Readd the import of the platform from config file, but add a deprecation warning

* More comments updated

* Fix lefover index

* Fix unique id to be backwards compatible

* Fix small bug in covers

* Fix testcases

* Changes for theenery dashboard

* Fixed services

* Fix memo text

* Make the interface for a service the port string instead of the device selector

* Fix set_memo_text

* added an async scan task, more comments

* Accidently disabled some paltforms

* More comments, bump version

* Bump version, add extra attributes, enable mypy

* Removed new features

* More comments

* Bump version

* Update homeassistant/components/velbus/__init__.py

Co-authored-by: brefra <frank_van_breugel@hotmail.com>

* Readd the import step

Co-authored-by: brefra <frank_van_breugel@hotmail.com>
2021-09-13 08:22:46 +02:00
jan iversen 1f997fcd58
Update pymodbus fixtures to use autospec (#55686) 2021-09-12 21:16:48 -07:00
Paulus Schoutsen 32212651fe
Add zeroconf discovery to Hue (#55358)
* Add zeroconf discovery to Hue

* Add coverage for already exists case

Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-12 20:00:51 -07:00
joshs85 41b25a765c
Changed wording of bond state belief feature from belief to tracked state (#56147)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-12 15:46:43 -10:00
jan iversen 990d474d02
use fixtures. (#56130) 2021-09-12 15:08:46 -07:00
J. Nick Koston 673519f6bf
Prefer more targeted matchers in USB discovery (#56142)
- If there is a more targeted match it should win discovery
2021-09-12 15:07:40 -07:00
J. Nick Koston 0fc89780e9
Fix listener leak in HomeKit on reload (#56143)
* Fix listener leak in HomeKit on reload

* Fix mocking
2021-09-12 15:06:03 -07:00
Greg Thornton f1556ead6d
Don't cache HomeKit camera stream source from entity (#56136) 2021-09-12 08:09:09 -07:00
Greg Thornton 371aa03bca
Add audio support option to HomeKit camera UI config flow (#56107) 2021-09-11 16:41:30 -10:00
J. Nick Koston eff59e8b00
Use the same server name for all HomeKit bridges (#55860) 2021-09-11 19:00:26 -07:00
Steven Looman 73260c5b88
Move parts of ssdp to async_upnp_client (#55540)
* Move parts of ssdp to async_upnp_client

* Fix test for environments with multiple sources

* Fix sonos tests

* More fixes/changes

* More fixes

* Use async_upnp_client==0.21.0

* Pylint/test fixes

* More changes after review

* Fix tests

* Improve testing

* Fix mypy

* Fix yamaha_musiccast tests?

* Changes after review

* Pylint

* Reduce calls to combined_headers

* Update to async_upnp_client==0.21.1

* Update to async_upnp_client==0.21.2

* use as_dict

Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-11 13:38:16 -10:00
Shay Levy f1a88f0563
Add config flow support for RPC device (#56118) 2021-09-11 23:28:33 +03:00
Joakim Sørensen bcb3c426f4
Blank out discovery info (#56097) 2021-09-11 12:34:19 -07:00
jan iversen cb8c0cb123
Update template/test_lock.py to use pytest (#56102) 2021-09-11 11:48:25 -07:00
Joakim Sørensen 1b46190a0c
Add view to get installation type during onboarding (#56095) 2021-09-11 15:38:38 +02:00
Michael b11db0b1d7
Remove unnecessary extra attribute from NUT sensors (#56078) 2021-09-10 19:17:46 -07:00
Raman Gupta c785983cce
Handle entity creation on new added zwave_js value (#55987)
* Handle new entity creation when a new value is added

* spacing

* Update homeassistant/components/zwave_js/__init__.py

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

* change variable name and use asyncio.gather

* Centralized where discovered value IDs gets managed

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-09-10 23:49:31 +02:00
Shay Levy 8c3c2ad8e3
Updated changes for aioshelly 1.0.0 (#56083) 2021-09-11 00:48:55 +03:00
jan iversen ac1251c52b
Update template/test_trigger.py to use pytest (#55950) 2021-09-10 09:55:51 -07:00