Commit Graph

402 Commits

Author SHA1 Message Date
Marc Mueller b2a4de6eed
Enable strict typing for duotecno (#107261) 2024-01-05 18:39:18 +01:00
Marc Mueller de72bbfaad
Enable strict typing for minecraft_server (#107262) 2024-01-05 18:38:31 +01:00
Marc Mueller f0b47bf00c
Enable strict typing for downloader (#107263) 2024-01-05 18:35:05 +01:00
Alexander Somov d754ea7e22
Add new Rabbit Air integration (#66130)
* Add new Rabbit Air integration

* Remove py.typed file

It is not needed and was just accidentally added to the commit.

* Enable strict type checking for rabbitair component

Keeping the code fully type hinted is a good idea.

* Add missing type annotations

* Remove translation file

* Prevent data to be added to hass.data if refresh fails

* Reload the config entry when the options change

* Add missing type parameters for generics

* Avoid using assert in production code

* Move zeroconf to optional dependencies

* Remove unnecessary logging

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

* Remove unused keys from the manifest

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

* Replace property with attr

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

* Allow to return None for power

The type of the is_on property now allows this.

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

* Remove unnecessary method call

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

* Update the python library

The new version properly re-exports names from the package root.

* Remove options flow

Scan interval should not be part of integration configuration. This was
the only option, so the options flow can be fully removed.

* Replace properties with attrs

* Remove multiline ternary operator

* Use NamedTuple for hass.data

* Remove unused logger variable

* Move async_setup_entry up in the file

* Adjust debouncer settings to use request_refresh

* Prevent status updates during the cooldown period

* Move device polling code to the update coordinator

* Fix the problem with the switch jumping back and forth

The UI seems to have a timeout of 2 seconds somewhere, which is just a
little bit less than what we normally need to get an updated state. So
the power switch would jump to its previous state and then immediately
return to the new state.

* Update the python library

The new version fixes errors when multiple requests are executed
simultaneously.

* Fix incorrect check for pending call in debouncer

This caused the polling to stop.

* Fix tests

* Update .coveragerc to exclude new file.
* Remove test for Options Flow.

* Update the existing entry when device access details change

* Add Zeroconf discovery step

* Fix tests

The ZeroconfServiceInfo constructor now requires one more argument.

* Fix typing for CoordinatorEntity

* Fix signature of async_turn_on

* Fix depreciation warnings

* Fix manifest formatting

* Fix warning about debouncer typing

relates to 5ae5ae5392

* Wait for config entry platform forwards

* Apply some of the suggested changes

* Do not put the MAC address in the title. Use a fixed title instead.
* Do not format the MAC to use as a unique ID.
* Do not catch exceptions in _async_update_data().
* Remove unused _entry field in the base entity class.
* Use the standard attribute self._attr_is_on to keep the power state.

* Store the MAC in the config entry data

* Change the order of except clauses

OSError is an ancestor class of TimeoutError, so TimeoutError should be
handled first

* Fix depreciation warnings

* Fix tests

The ZeroconfServiceInfo constructor arguments have changed.

* Fix DeviceInfo import

* Rename the method to make it clearer what it does

* Apply suggestions from code review

* Fix tests

* Change speed/mode logic to use is_on from the base class

* A zero value is more appropriate than None

since None means "unknown", but we actually know that the speed is zero
when the power is off.

---------

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-01-05 16:34:28 +01:00
Scott K Logan f249563608
Add Rainforest RAVEn integration (#80061)
* Add Rainforest RAVEn integration

* Add Rainforest Automation brand

* Add diagnostics to Rainforest RAVEn integration

* Drop a test assertion for an undefined behavior

* Add DEVICE_NAME test constant

* Catch up with reality

* Use Platform.SENSOR

Co-authored-by: Robert Resch <robert@resch.dev>

* Make rainforest_raven translatable

* Stop setting device_class on unsupported scenarios

* Rename rainforest_raven.data -> rainforest_raven.coordinator

* Make _generate_unique_id more reusable

* Move device synchronization into third party library

* Switch from asyncio_timeout to asyncio.timeout

* Ignore non-electric meters

Co-authored-by: Robert Resch <robert@resch.dev>

* Drop direct dependency on iso4217, bump aioraven

* Use RAVEn-specific exceptions

* Add timeouts to data updates

* Move DeviceInfo generation from Sensor to Coordinator

* Store meter macs as strings

* Convert to using SelectSelector

* Drop test_flow_user_invalid_mac

This test isn't necessary now that SelectSelector is used.

* Implement PR feedback

- Split some long format lines
- Simplify meter mac_id extraction in diagnostics
- Expose unique_id using an attribute instead of a property
- Add a comment about the meters dictionary shallow copy

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

* Simplify mac address redaction

Co-authored-by: Joakim Sørensen <ludeeus@ludeeus.dev>

* Freeze RAVEnSensorEntityDescription dataclass

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

---------

Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Joakim Sørensen <ludeeus@ludeeus.dev>
2024-01-05 14:00:54 +01:00
Marc Mueller b3f997156a
Enable strict typing for counter (#106906) 2024-01-03 09:06:26 +01:00
Marc Mueller 1526c321f1
Enable strict typing for axis (#106844) 2024-01-02 20:55:59 +01:00
Marc Mueller 43fa51b696
Enable strict typing for blueprint (#106887) 2024-01-02 20:48:51 +01:00
Marc Mueller fde03d7888
Enable strict typing for co2signal (#106888) 2024-01-02 20:41:39 +01:00
Marc Mueller dcee8e67c4
Add strict typing to command_line (#106889)
* Add strict typing to command_line

* Code review
2024-01-02 20:04:28 +01:00
Franck Nijhof 2d0325a471
Mark stt entity component as strictly typed (#106723)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2024-01-02 17:07:47 +01:00
Erik Montnemery 8f9bd75a36
Enable strict typing of date_time (#106868)
* Enable strict typing of date_time

* Fix parse_datetime

* Add test

* Add comments

* Update tests/util/test_dt.py

Co-authored-by: G Johansson <goran.johansson@shiftit.se>

---------

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2024-01-02 13:57:25 +01:00
Marc Mueller 6e6575afe5
Enable strict typing for apache_kafka (#106823) 2024-01-02 13:29:38 +01:00
Franck Nijhof 06fa306821
Mark humidifier entity component as strictly typed (#106721)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2024-01-02 13:29:07 +01:00
Marc Mueller 4747460286
Enable strict typing for arwn (#106840) 2024-01-02 13:07:47 +01:00
Marc Mueller 8903aecb77
Enable strict typing for airthings (#106814) 2024-01-02 11:38:20 +01:00
Marc Mueller d93d25a7d1
Enable strict typing for ambiclimate (#106819) 2024-01-01 18:09:22 -10:00
Marc Mueller aec8dc13b2
Improve acmeda typing (#106812) 2024-01-01 22:16:22 +01:00
Marc Mueller 73ccd0d310
Enable strict typing for arcam_fmj (#106837) 2024-01-01 21:12:29 +01:00
Marc Mueller 33f8a364ab
Enable strict typing for arris_tg2492lg (#106838) 2024-01-01 20:47:37 +01:00
Marc Mueller 8501b2e71b
Enable strict typing for asterisk_cdr + asterisk_mbox (#106841) 2024-01-01 20:45:16 +01:00
Marc Mueller 3b0d877b5e
Enable strict typing for amberelectric (#106817) 2024-01-01 20:35:34 +01:00
Marc Mueller c5c132e1d4
Enable strict typing for airq (#106813) 2024-01-01 20:33:38 +01:00
Marc Mueller f67bae2cde
Enable strict typing for aruba (#106839) 2024-01-01 20:33:15 +01:00
Marc Mueller 800351287b
Enable strict typing for aquostv (#106836) 2024-01-01 20:32:29 +01:00
Marc Mueller 0077989169
Enable strict typing for alpha_vantage (#106816) 2024-01-01 20:19:19 +01:00
Marc Mueller 4e0c0cf2ca
Enable strict typing for androidtv (#106820) 2024-01-01 20:15:01 +01:00
Marc Mueller 06a5e25853
Enable strict typing for anel_pwrctrl (#106821) 2024-01-01 20:14:34 +01:00
Marc Mueller c37e268030
Enable strict typing for aprs (#106824) 2024-01-01 20:14:00 +01:00
Marc Mueller 3433e1d349
Enable strict typing for airthings_ble (#106815) 2024-01-01 18:56:44 +01:00
Franck Nijhof b1dd064f2d
Mark time entity component as strictly typed (#106720) 2023-12-31 02:52:59 +01:00
Franck Nijhof 1849d68e78
Mark siren entity component as strictly typed (#106719) 2023-12-30 20:21:33 +01:00
Franck Nijhof ff25211bf9
Mark wake_word entity component as strictly typed (#106724) 2023-12-30 20:20:33 +01:00
Franck Nijhof 2a6a347cd0
Mark datetime entity component as strictly typed (#106717) 2023-12-30 15:47:08 +01:00
Franck Nijhof faa2129e96
Mark todo entity component as strictly typed (#106718) 2023-12-30 14:32:44 +01:00
Franck Nijhof 4764af96a8
Mark date entity component as strictly typed (#106716) 2023-12-30 14:23:43 +01:00
Josef Zweck 02b863e968
Add tedee integration (#102846)
* init tedee

* init tests

* add config flow tests

* liniting

* test

* undo

* linting

* pylint

* add tests

* more tests

* more tests

* update snapshot

* more tests

* typing

* strict typing

* cleanups

* cleanups, fix tests

* remove extra platforms

* remove codeowner

* improvements

* catch tedeeclientexception

* allow bridge selection in CF

* allow bridge selection in CF

* allow bridge selection in CF

* allow bridge selection in CF

* abort earlier

* auto-select bridge

* remove cloud token, optionsflow to remove size

* remove options flow leftovers

* improve coverage

* defer coordinator setting to after first update

* define coordinator

* some improvements

* remove diagnostics, webhook

* remove reauth flow, freeze data classes

* fix lock test

* Update homeassistant/components/tedee/entity.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/tedee/__init__.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/tedee/config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/tedee/entity.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/tedee/entity.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* requested changes

* requested changes

* Update lock.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update entity.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update lock.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* requested changes

* Update tests/components/tedee/test_lock.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update tests/components/tedee/test_lock.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update tests/components/tedee/test_lock.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update tests/components/tedee/test_lock.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update tests/components/tedee/conftest.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/tedee/coordinator.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/tedee/lock.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update tests/components/tedee/test_config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/tedee/strings.json

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/tedee/strings.json

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/tedee/lock.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/tedee/strings.json

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/tedee/lock.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* requested changes

* requested changes

* requested changes

* revert load fixture

* change tests

* Update test_config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update strings.json

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update coordinator.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* remove warning

* move stuff out of try

* add docstring

* tedee lowercase, time.time

* back to some uppercase, time.time

* awaitable

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2023-12-29 14:55:41 +01:00
Joost Lekkerkerker e469c6892b
Add Airnow to strict typing (#105566) 2023-12-23 15:16:15 -10:00
Sid bd6e2c54e1
Use shorthand attributes in enigma2 (#106318)
* enigma2: add strict typing, change property functions to _attr_*

* applied changes of review

* changes from review
2023-12-23 23:12:03 +01:00
Floris272 8b0d19aca2
Add bluecurrent integration (#82483)
* Add bluecurrent integration

* Apply feedback

* Rename integration

* changed constants and removed strings.sensor.json

* update blue_current integration

* update bluecurrent-api to 1.0.4

* Update bluecurrent-api to 1.0.5

* Apply feedback

* Remove translation

* Apply feedback

* Use customer_id as unique id

* Apply feedback

* Add @pytest.mark.parametrize

* Replace loop.create_task with async_create_task
2023-12-22 16:34:16 +01:00
RJPoelstra 2c2e6171e2
Add integration for Vogel's MotionMount (#103498)
* Skeleton for Vogel's MotionMount support.

* Generated updates.

* Add validation of the discovered information.

* Add manual configuration

* Use a mac address as a unique id

* Add tests for config_flow

* Add a 'turn' sensor entity.

* Add all needed sensors.

* Add number and select entity for control of MotionMount

* Update based on development checklist

* Preset selector now updates when a preset is chosen

* Fix adding presets selector to device

* Remove irrelevant TODO

* Bump python-MotionMount requirement

* Invert direction of turn slider

* Prepare for PR

* Make sure entities have correct values when created

* Use device's mac address as unique id for entities.

* Fix missing files in .coveragerc

* Remove typing ignore from device library.

Improved typing also gave rise to the need to improve the callback mechanism

* Improve typing

* Convert property to shorthand form

* Remove unneeded CONF_NAME in ConfigEntry

* Add small comment

* Refresh coordinator on notification from MotionMount

* Use translation for entity

* Bump python-MotionMount

* Raise `ConfigEntryNotReady` when connect fails

* Use local variable

* Improve exception handling

* Reduce duplicate code

* Make better use of constants

* Remove unneeded callback

* Remove other occurrence of unneeded callback

* Improve removal of suffix

* Catch 'getaddrinfo' exception

* Add config flow tests for invalid hostname

* Abort if device with same hostname is already configured

* Make sure we connect to a device with the same unique id as configured

* Convert function names to snake_case

* Remove unneeded commented-out code

* Use tuple

* Make us of config_entry id when mac is missing

* Prevent update of entities when nothing changed

* Don't store data in `hass.data` until we know we will proceed

* Remove coordinator

* Handle situation where mac is EMPTY_MAC

* Disable polling

* Fix failing hassfest

* Avoid calling unique-id-less discovery handler for situations where we've an unique id
2023-12-22 12:04:58 +01:00
David Bonnes aa9f00099d
Make evohome strictly typed (#106012)
* initial commit

* return to conventional approach

* add type hint for wrapper

* use walrus operator
2023-12-21 13:22:42 +01:00
Miguel Camba 5175737b60
Add Valve integration (#102184)
* Add Valve integration.

This adds the valve integration discussed in https://github.com/home-assistant/architecture/discussions/975
Most of the code is taken from the cover integration but simplified since valves
can't tilt.

There are a couple outstanding errors I'm not sure how to solve and prevents
me from even making this commit without `--no-verify`.

* Apply PR feedback

* Apply more feedback: Intruduce the bare minimum

* Remove file commited by mistake

* Hopefully this fixes tests

* Match cover's typing and mypy settings

* Change some configuration files

* Fix test

* Increase code coverage a little

* Code coverate inproved to 91%

* 95% code coverage

* Coverate up to 97%

* Coverage 98%

* Apply PR feedback

* Even more feedback

* Add line I shouldn't have removed

* Derive closed/open state from current position

* Hopefully last feedback

* Update homeassistant/components/valve/__init__.py

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

* Update homeassistant/components/valve/__init__.py

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

* Remove unnecesary translation

* Remove unused method arguments

* Complete code coverage

* Update homeassistant/components/valve/__init__.py

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

* Simplify tests

* Update homeassistant/components/valve/__init__.py

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

* Apply last feedback

* Update tests/components/valve/test_init.py

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

* Update tests/components/valve/test_init.py

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

* Update tests/testing_config/custom_components/test/valve.py

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

* More feedback

* Apply suggestion

* And more feedback

* Apply feedback

* Remove commented code

* Reverse logic to unindent

* Update homeassistant/components/valve/__init__.py

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

* Update homeassistant/components/valve/__init__.py

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

* Implement stop valve for Mock valve

* Fix tests now that I've implemented stop_valve

* Assert it's neither opening nor closing

* Use current position instead

* Avoid scheduling executor when opening or closing

* Fix incorrect bitwise operation

* Simplify toggle

* Remove uneeded partial functions

* Make is_last_toggle_direction_open private

* Remove valve from test custom integration

* Improve test coverage

* Address review comments

* Address review comments

* Address review comments

* Update homeassistant/components/valve/__init__.py

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

* Update tests

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Erik <erik@montnemery.com>
2023-12-18 19:48:00 +01:00
Joost Lekkerkerker 0d049d73cf
Add AndroidTV remote to strict typing (#105571)
Co-authored-by: Robert Resch <robert@resch.dev>
2023-12-18 10:34:39 +01:00
Franck Nijhof d50b79ba84
Add Tailwind integration (#105926)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2023-12-18 08:42:53 +01:00
Joost Lekkerkerker 283ff4fada
Add Adax to strict typing (#105562) 2023-12-12 21:29:18 +01:00
Joost Lekkerkerker 0e5d72a501
Add Android IP webcam to strict typing (#105570) 2023-12-12 20:54:35 +01:00
Joost Lekkerkerker 84bffcd2e1
Add Aranet to strict typing (#105577) 2023-12-12 20:54:00 +01:00
Joost Lekkerkerker 09b07c071b
Add Apprise to strict typing (#105575) 2023-12-12 20:53:36 +01:00
Joost Lekkerkerker 64c3cfca17
Add Airvisual pro to strict typing (#105568) 2023-12-12 17:27:41 +01:00