Commit Graph

13380 Commits (fac2a46781b288148b7273d10524c0eb68c7fc49)

Author SHA1 Message Date
Jan Bouwhuis dea221b155 Link manually added MQTT entities the the MQTT config entry ()
Co-authored-by: Erik <erik@montnemery.com>
2022-09-21 22:20:56 -04:00
Jan Bouwhuis 3dd0dbf38f Make hass.data["mqtt"] an instance of a DataClass ()
* Use dataclass to reference hass.data globals

* Add discovery_registry_hooks to dataclass

* Move discovery registry hooks to dataclass

* Add device triggers to dataclass

* Cleanup DEVICE_TRIGGERS const

* Add last_discovery to data_class

* Simplify typing for class `Subscription`

* Follow up on comment

* Redo suggested typing change to sasisfy mypy

* Restore typing

* Add mypy version to CI check logging

* revert changes to ci.yaml

* Add docstr for protocol

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>

* Mypy update after merging 

* Remove mypy ignore

* Correct return type

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2022-09-21 22:15:47 -04:00
Jan Bouwhuis 4894e2e5a4 Refactor common MQTT tests to use modern schema ()
* Common tests availability

* Common tests attributes

* Common tests unique id

* Common tests discovery

* Common tests encoding

* Common tests device info

* Common tests entity_id updated

* Common tests entity debug info

* Common test entity category

* Common tests setup reload unload+corrections

* Cleanup sweep

* Comments from curent change

* Cleanup

* Remove unused legacy config
2022-09-21 22:15:46 -04:00
Jan Bouwhuis e7a616e8e4 Refactor MQTT tests to use modern platform schema part 2 ()
* Tests light json

* Tests light template

* Missed test light json

* Tests light

* Tests lock

* Tests number

* Tests scene

* Tests select

* Tests sensor

* Tests siren

* Tests state vacuuum

* Tests switch

* Derive DEFAULT_CONFIG_LEGACY from DEFAULT_CONFIG

* Suggested comment changes
2022-09-21 22:15:46 -04:00
Jan Bouwhuis b3a4838978 Refactor MQTT tests to use modern platform schema part 1 ()
* Tests alarm_control_panel

* Tests binary_sensor

* Tests button

* Tests camera

* Tests Climate + corrections default config

* Tests cover

* Tests device_tracker

* Tests fan

* Tests humidifier

* Fix test_supported_features test fan

* Tests init

* Tests legacy vacuum

* Derive DEFAULT_CONFIG_LEGACY from DEFAULT_CONFIG

* Commit suggestion comment changes
2022-09-21 22:15:45 -04:00
J. Nick Koston 454675d86b Fix bluetooth callback matchers when only matching on connectable () 2022-09-18 13:13:08 -04:00
Franck Nijhof cce4496ad6 Remove mDNS iteration from Plugwise unique ID ()
* Remove mDNS iteration from Plugwise unique ID

* Add iteration to tests
2022-09-18 13:10:11 -04:00
Raman Gupta ebeebeaec1 Handle multiple files properly in zwave_js update entity ()
* Handle multiple files properly in zwave_js update entity

* Until we have progress, set in progress to true. And fix when we write state

* fix tests

* Assert we set in progress to true before we get progress

* Fix tests

* Comment
2022-09-18 13:10:10 -04:00
J. Nick Koston a2aa0e608d Add a helpful message to the config_entries.OperationNotAllowed exception ()
We only expect this exception to be raised as a result of an
implementation problem. When it is raised during production
it is currently hard to trace down why its happening

See 
2022-09-18 13:10:09 -04:00
Franck Nijhof 3a89a49d4a Fix WebSocket condition testing () 2022-09-18 13:10:06 -04:00
Raman Gupta c1809681b6 Fix zwave_js update entity startup state ()
* Fix update entity startup state

* Only write state if there is a change

* Add test to show that when an existing entity gets recreated, skipped version does not reset

* Remove unused blocks

* Update homeassistant/components/zwave_js/update.py

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2022-09-18 13:10:05 -04:00
Erik Montnemery 40c5689507 Prevent deleting blueprints which are in use () 2022-09-18 12:57:40 -04:00
Raman Gupta a4749178f1 Only redact zwave_js values that are worth redacting ()
* Only redact zwave_js values that are worth redacting

* Tweak test

* Use redacted fixture for test
2022-09-18 12:56:40 -04:00
Diogo Gomes 7b83807baa Retry on unavailable IPMA api ()
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-09-13 21:01:19 -04:00
J. Nick Koston 843d5f101a Fix flapping system log test ()
Since we run tests with asyncio debug on, there is
a chance we will get an asyncio log message instead
of the one we want

Fixes https://github.com/home-assistant/core/actions/runs/3045080236/jobs/4906717578
2022-09-13 16:31:38 -04:00
Erik Montnemery 8599472880 Don't allow partial update of timer settings () 2022-09-13 16:31:37 -04:00
Erik Montnemery 04d6bb085b Don't allow partial update of input_text settings () 2022-09-13 16:31:36 -04:00
Erik Montnemery 6f9a311cec Don't allow partial update of input_select settings () 2022-09-13 16:31:35 -04:00
Erik Montnemery 336179df6d Don't allow partial update of input_button settings () 2022-09-13 16:31:34 -04:00
Erik Montnemery 9459af30b0 Don't allow partial update of input_datetime settings () 2022-09-13 16:31:34 -04:00
Erik Montnemery ee07ca8caa Don't allow partial update of input_boolean settings () 2022-09-13 16:31:33 -04:00
Erik Montnemery 3beed13586 Don't allow partial update of counter settings () 2022-09-13 16:31:33 -04:00
J. Nick Koston cd7f65bb6a Bump xiaomi-ble to 0.9.3 () 2022-09-13 16:31:30 -04:00
Erik Montnemery ad396f0538 Don't allow partial update of input_number settings () 2022-09-13 16:30:44 -04:00
Erik Montnemery 12edfb3929 Drop initial when loading input_number from storage () 2022-09-13 16:30:43 -04:00
J. Nick Koston 47f6be77cc Bump bleak to 0.17.0 () 2022-09-13 16:30:42 -04:00
Erik Montnemery 9acf74d783 Fix calculating gas cost for gas measured in ft3 () 2022-09-13 16:30:42 -04:00
David F. Mulcahey 0aa2685e0c Fix sengled bulbs in ZHA ()
* Fix sengled bulbs in ZHA

* fix tests

* update discovery data
2022-09-13 16:30:41 -04:00
puddly 183c61b6ca Bump ZHA dependencies () 2022-09-10 14:37:05 -04:00
Jc2k 258791626e Add missing moisture sensor to xiaomi_ble () 2022-09-09 22:37:35 -04:00
Erik Montnemery 2b961fd327 Improve unique_id collision checks in entity_platform () 2022-09-09 22:37:31 -04:00
Raman Gupta 125afb39f0 Fix zwave_js update entity ()
* Test zwave_js update entity progress

* Block until firmware update is done

* Update homeassistant/components/zwave_js/update.py

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

* revert params

* unsub finished event listener

* fix tests

* Add test for returned failure

* refactor a little

* rename

* Remove unnecessary controller logic for mocking

* Clear event when resetting

* Comments

* readability

* Fix test

* Fix test

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-09-09 22:37:31 -04:00
Paulus Schoutsen f042cc5d7b Handle missing supported brands () 2022-09-09 22:37:29 -04:00
Jan Bouwhuis 21f6b50f7c Clear MQTT discovery topic when a disabled entity is removed ()
* Cleanup discovery on entity removal

* Add test

* Cleanup and test

* Test with clearing payload not unique id

* Address comments

* Tests cover and typing

* Just pass hass

* reuse code

* Follow up comments revert changes to cover tests

* Add test unique_id has priority over disabled

* Update homeassistant/components/mqtt/__init__.py

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

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-09-09 22:37:27 -04:00
Jan Bouwhuis d670df74cb Fix reload of MQTT config entries ()
* Wait for unsubscribes

* Spelling comment

* Remove notify_all() during _register_mid()

* Update homeassistant/components/mqtt/client.py

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

* Correct handling reload manual set up MQTT items

* Save and restore device trigger subscriptions

* Clarify we are storing all remaining subscriptions

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-09-09 22:37:27 -04:00
Jan Bouwhuis c873eae79c Allow OpenWeatherMap config flow to test using old API to pass ()
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-09-08 16:50:13 -04:00
Nathan Spencer d559b6482a Bump pylitterbot to 2022.9.1 () 2022-09-08 16:50:12 -04:00
Martin Hjelmare 3b025b211e Fix zwave_js device re-interview ()
* Handle stale node and entity info on re-interview

* Add test

* Unsubscribe on config entry unload
2022-09-08 16:50:10 -04:00
Martin Hjelmare 31858ad779 Fix zwave_js default emulate hardware in options flow () 2022-09-08 16:50:08 -04:00
Raman Gupta ab9d9d599e Add value ID to zwave_js device diagnostics () 2022-09-08 16:50:07 -04:00
Franck Nijhof 8d0ebdd1f9
Revert "Add ability to ignore devices for UniFi Protect" () 2022-09-07 17:45:16 +02:00
Raman Gupta 9901b31316
Bump zwave-js-server-python to 0.41.1 ()
* Bump zwave-js-server-python to 0.41.1

* Fix fixture
2022-09-07 17:45:11 +02:00
Chris McCurdy a4f528e908
Add additional method of retrieving UUID for LG soundbar configuration () 2022-09-07 17:45:05 +02:00
puddly 9aa87761cf
Fix ZHA lighting initial hue/saturation attribute read ()
* Handle the case of `current_hue` being `None`

* WIP unit tests
2022-09-07 17:45:00 +02:00
Raman Gupta a13438c5b0 Improve performance impact of zwave_js update entity and other tweaks ()
* Improve performance impact of zwave_js update entity and other tweaks

* Reduce concurrent polls

* we need to write state after setting in progress to false

* Fix existing tests

* Fix tests by fixing fixtures

* remove redundant conditional

* Add test for delayed startup

* tweaks

* outdent happy path

* Add missing PROGRESS feature support

* Update homeassistant/components/zwave_js/update.py

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

* Update homeassistant/components/zwave_js/update.py

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

* Fix tests by reverting outdent, PR comments, mark callback

* Remove redundant conditional

* make more readable

* Remove unused SCAN_INTERVAL

* Catch FailedZWaveCommand

* Add comment and remove poll unsub on update

* Fix catching error and add test

* readability

* Fix tests

* Add assertions

* rely on built in progress indicator

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-09-06 12:55:35 -04:00
J. Nick Koston 31d085cdf8 Fix history stats device class when type is not time () 2022-09-06 12:55:31 -04:00
G Johansson 2bfcdc66b6 Allow empty db in SQL options flow () 2022-09-06 12:55:29 -04:00
Steven Looman 74ddc336ca Use identifiers host and serial number to match device () 2022-09-06 12:55:28 -04:00
J. Nick Koston bca9dc1f61 Bump govee-ble to 0.17.2 () 2022-09-05 14:28:25 -04:00
Jc2k b0ff4fc057 Less verbose error logs for bleak connection errors in ActiveBluetoothProcessorCoordinator ()
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-09-05 14:28:23 -04:00