Commit Graph

69 Commits (60fe6ff7713ba79a3bb5dbc7afd96f454c052265)

Author SHA1 Message Date
J. Nick Koston 0eca433004
Update zeroconf discovery to use IPAddress objects to avoid conversions (#100567) 2023-09-19 18:58:46 +02:00
Joost Lekkerkerker 8675bc6554
Migrate Tradfri to has entity name (#96248) 2023-07-18 20:56:50 +02:00
Martin Hjelmare 33b16d20b1
Clean up tradfri import flow (#88588) 2023-02-22 10:53:48 +01:00
epenet 9a5f88f55f
Add type hints to integration tests (part 23) (#88235) 2023-02-17 16:40:46 +01:00
Franck Nijhof ed79265843
Enable Ruff PT006 (#88165)
* Enable Ruff PT006

* Adjust existing cases

* Fix tests

* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
Martin Hjelmare e1a5d5a749
Refactor tradfri sensor tests (#88026) 2023-02-14 13:35:27 +01:00
Martin Hjelmare ab2ab1573e
Refactor tradfri diagnostics tests (#88017) 2023-02-13 18:39:48 +01:00
Martin Hjelmare 8993a36e27
Refactor tradfri fan tests (#87999) 2023-02-13 15:40:21 +01:00
epenet 278050a73f
Add type hints to integration tests (t-z) (#87707) 2023-02-08 19:10:53 +01:00
Martin Hjelmare 630028106a
Refactor tradfri cover tests (#87710)
* Refactor tradfri cover tests

* Complete typing
2023-02-08 18:31:04 +01:00
Martin Hjelmare 0aa489e3f0
Refactor tradfri switch tests (#86816)
Co-authored-by: Patrik Lindgren <21142447+ggravlingen@users.noreply.github.com>
2023-02-05 21:02:17 +01:00
Franck Nijhof ca1a12898c
Enable Ruff D212 (#87347) 2023-02-03 23:08:48 +01:00
epenet a79be493e5
Adjust hass_client type hint in integration tests (#86954)
* Adjust hass_client type hint in integration tests

* Adjust hass_client_no_auth

* Fix rebase
2023-02-02 16:29:57 -05:00
Martin Hjelmare b1e939d1f1
Fix tradfri air quality device class (#86861) 2023-01-28 22:05:31 -05:00
Franck Nijhof e9543a7254
Enable Ruff PT021 (#86801) 2023-01-27 17:14:04 +01:00
epenet 30bf0634fe
Add per-file-ignore to pylint (#86289) 2023-01-22 17:26:24 +01:00
Jelte Zeilstra f99d26231f
Add state_class to Tradfri battery and air quality sensors (#84185) 2022-12-18 16:52:08 +01:00
Franck Nijhof 7cd68381f1
Search/replace RESULT_TYPE_* by FlowResultType enum (#74642) 2022-07-07 19:57:36 +03:00
Patrik Lindgren 74021d62da
Finalize deprecation of groups in Tradfri integration (#69460)
* Finalise cleanup of groups

* Fix tests

* Remove

* Revert change
2022-04-07 22:19:12 +02:00
Patrik Lindgren 04fc3a1f25
Cleanup constants in Tradfri integration (#69125)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-04-05 14:00:45 +02:00
Patrik Lindgren 4b5996c5ed
Drop support for Tradfri groups and YAML configuration (#68033)
* Drop support for Tradfri groups

* Remove context

* Remove async_setup

* Mark removed

* Pass generator expression
2022-04-01 23:26:35 +02:00
Joshua Roys 9134e5c844
Get discovered zeroconf IPv6 addresses (#65462) 2022-02-11 16:46:17 -06:00
Patrik Lindgren f8a84f0101
Add diagnostics for Tradfri platform (#66092)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-02-08 22:05:33 +01:00
Patrik Lindgren afd0005a31
Add sensor for filter time left on Tradfri fan platform (#65877)
* Add support for filter time left

* Fix test for fan platform

* Remove debug code

* Add unique id migration tool

* Convert to hours

* Fix tests

* Apply suggestions from code review

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

* Add comment, check migration

* Refactor migration helper

* Refactor migration helper

* Move definition of new unique id

* Return after warning

* Add test for unique id migration

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-02-08 02:21:22 +01:00
Martin Hjelmare d0412d65ac
Remove stale tradfri devices (#65218) 2022-01-31 16:43:16 -08:00
Patrik Lindgren 3ca1b2fc6e
Add air quality sensor for Tradfri air purifier (#65070)
* Add air quality sensor for Tradfri fan platform

* Refactor, use entity description

* Fix typo

* CHange init docstring

* Let lambda handle special case

* Remove unique id

* Apply suggestions from code review

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

* Refactor to constants, add mixin

* Rename lambda

* Update homeassistant/components/tradfri/sensor.py

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

* Update homeassistant/components/tradfri/sensor.py

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

* Update homeassistant/components/tradfri/sensor.py

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

* Replace lambda with function

* Refactor device init

* Remove fixture scope

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-01-29 23:55:05 +01:00
Patrik Lindgren 70321ed795
Add battery sensor for Tradfri blinds (#65067) 2022-01-27 17:47:47 +01:00
Patrik Lindgren 9d404b749a
Implement coordinator class for Tradfri integration (#64166)
* Initial commit coordinator

* More coordinator implementation

* More coordinator implementation

* Allow integration reload

* Move API calls to try/catch block

* Move back fixture

* Remove coordinator test file

* Ensure unchanged file

* Ensure unchanged conftest.py file

* Remove coordinator key check

* Apply suggestions from code review

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

* Import RequestError

* Move async_setup_platforms to end of setup_entry

* Remove centralised handling of device data and device controllers

* Remove platform_type argument

* Remove exception

* Remove the correct exception

* Refactor coordinator error handling

* Apply suggestions from code review

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

* Remove platform type from base class

* Remove timeout context manager

* Refactor exception callback

* Simplify starting device observation

* Update test

* Move observe start into update method

* Remove await self.coordinator.async_request_refresh()

* Refactor cover.py

* Uncomment const.py

* Add back extra_state_attributes

* Update homeassistant/components/tradfri/coordinator.py

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

* Refactor switch platform

* Expose switch state

* Refactor sensor platform

* Put back accidentally deleted code

* Add set_hub_available

* Apply suggestions from code review

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

* Fix tests for fan platform

* Update homeassistant/components/tradfri/base_class.py

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

* Update homeassistant/components/tradfri/base_class.py

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

* Fix non-working tests

* Refresh sensor state

* Remove commented line

* Add group coordinator

* Add groups during setup

* Refactor light platform

* Fix tests

* Move outside of try...except

* Remove error handler

* Remove unneeded methods

* Update sensor

* Update .coveragerc

* Move signal

* Add signals for groups

* Fix signal

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-01-27 11:12:52 +01:00
Patrik Lindgren e87fb6fc09
Add test cases for Tradfri sensor platform (#64165)
* Add tests for Tradfri sensor platform

* Update docstring
2022-01-15 15:53:03 +01:00
Patrik Lindgren c2181aa5fc
Add test cases for Tradfri switch platform (#64156)
* Add tests for the switch platform

* Fix typo

* Typos
2022-01-15 12:27:42 +01:00
Patrik Lindgren 66f1ac025d
Add test cases for Tradfri fan platform (#64135)
* Add test cases for Tradfri fan platform

* Remove line
2022-01-15 11:34:19 +01:00
Patrik Lindgren 03defdc922
Add test cases for Tradfri cover platform (#64072)
* Add test cases for Tradfri cover

* Simplify test

* Fix typo

* Fix typos

* Update tests/components/tradfri/test_cover.py

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

* Fix

* Remove unused function

* Move common tools to separate file

* Simplify parametrization

* Use int

* Remove loop

* Use context manager

* Simplify

* Update docstring

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-01-14 19:40:14 +01:00
Patrik Lindgren b52a8ba37a
Bump pytradfri to 8.0.1 and fix fan preset mode "Auto" bug (#63920)
* Move util functions

* Fix errors

* Revert changes

* Fix tests

* Use self.async_set_percentage()

* Fix calculation functions and associated tests

* Handle case of 0

* Update tests/components/tradfri/test_util.py

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

* Update tests/components/tradfri/test_util.py

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

* Update tests/components/tradfri/test_util.py

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

* Handle case of 0

* Update homeassistant/components/tradfri/fan.py

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-01-14 04:01:24 +01:00
epenet 9f74ad06d6
Update ZeroconfServiceInfo in tests (t-z) (#60221)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-23 11:28:50 -06:00
epenet 70f43a1415
Use ZeroconfServiceInfo in tradfri (#60112)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-22 11:49:37 +01:00
jan iversen 06d29040b9
Catch connection errors that makes tradfri hang in startup (#59368) 2021-11-09 13:00:50 +01:00
Patrik Lindgren c950f1ccfa
Initial support for Tradfri STARKVIND Air purifier (#58295)
* Initial commit

* Update homeassistant/components/tradfri/const.py

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

* Feedback

* Updates

* Remove logger

* Fix codestring

* Update homeassistant/components/tradfri/fan.py

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

* Update homeassistant/components/tradfri/fan.py

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

* Update homeassistant/components/tradfri/fan.py

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

* Percent value

* Add tests

* Typo

* Update tests

* Fix util function

* Update homeassistant/components/tradfri/fan.py

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

* Update after review

* Review

* Coverage

* Fix test

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-10-25 08:15:46 +02:00
jan iversen 45983b5edf
Activate tradfri in coverage and clean conftest for tradfri (#58058) 2021-10-20 13:36:02 +02:00
jan iversen 8d7744a74f
Warn user if Gateway is already paired (#57530)
* Warn user if Gateway is already paired.

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-10-13 07:16:55 +02:00
jan iversen 2d669a4613
Remove legacy code. (#54452) 2021-08-11 11:07:04 +02:00
Ville Skyttä 153d6e891e
Use config_entries.SOURCE_* constants (#49631) 2021-04-25 11:27:40 +02:00
Erik Montnemery b3fecb1c95
Update tests t-z to use async_get() instead of async_get_registry() (#47655) 2021-03-09 14:25:03 +01:00
Ville Skyttä dc880118a4
Lint suppression cleanups (#47248)
* Unused pylint suppression cleanups

* Remove outdated pylint bug references

* Add flake8-noqa config and note to run it every now and then

* Add codes to noqa's

* Unused noqa cleanups
2021-03-02 09:02:04 +01:00
Franck Nijhof 65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Paulus Schoutsen 5dac3883b0
Stub light profiles (#42232) 2020-10-23 16:28:21 +02:00
Martin Hjelmare 36632f64f1
Mock tradfri lights correctly (#39706) 2020-09-06 11:54:08 +02:00
Martin Hjelmare b6630a48b2
Add tradfri api call error handling (#39681)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2020-09-05 23:02:32 +02:00
Martin Hjelmare bde0bdbf80
Clean tradfri hass data and add tests (#39620) 2020-09-03 18:39:24 +02:00
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
Paulus Schoutsen 276f3afb00
Do async_setup_platform in background (#36244)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-05-31 22:18:30 -07:00