Commit Graph

87 Commits (9d1985ab033920c2f4d965b576fbc9771b893a15)

Author SHA1 Message Date
Tobias Sauerwein a1aaecb3bf
Use state class enums in Netatmo (#60725) 2021-12-01 19:40:51 +01:00
Tobias Sauerwein 037f4dbdb1
Use device class enums in Netatmo (#60723) 2021-12-01 18:30:47 +01:00
Marc Mueller e0c0d00833
Use assignment expressions 39 (#58829) 2021-10-31 18:56:25 +01:00
Tobias Sauerwein ac4496b985
Use async_on_unload in Netatmo (#58461) 2021-10-26 13:43:54 +02:00
Tobias Sauerwein ab66efba0e
Add entity categories to Netatmo (#58383) 2021-10-25 12:38:59 +02:00
Tobias Sauerwein 83e45300c2
Add `configuration_url` to Netatmo devices (#58160) 2021-10-22 11:14:28 +02:00
Tobias Sauerwein 7560c7b3de
Add long-term statistics support for rain sensors (#56847) 2021-10-01 07:24:55 +02:00
Erik Montnemery 103e21c278
Move temperature conversions to sensor base class (5/8) (#54475) 2021-08-12 13:26:17 +02:00
Franck Nijhof 91ab86c17c
Add state class support to Netatmo (#54051) 2021-08-05 12:29:00 +02:00
Marc Mueller 553521a76b
Add mixin classes for required keys in EntityDescription (#53610) 2021-07-28 11:50:13 +02:00
Marc Mueller b7f1f2330a
Use EntityDescription - netatmo (#53568)
* Use EntityDescription - netatmo

* Add coverage exclude

* Fix coverage exclude comment
2021-07-28 08:18:59 +02:00
Tobias Sauerwein 583deada83
Add type annotations for Netatmo (#52811) 2021-07-21 14:36:57 -07:00
Daniel Hjelseth Høyer 2cf930f3bd
Netatmo, use nameclass (#53247) 2021-07-21 08:46:01 +02:00
Marc Mueller f6b162bc39
Add pylint CodeStyle extension (#53147) 2021-07-19 06:57:06 -07:00
Marc Mueller c35b5a1c64
Add sound pressure unit constants (dB + dBa) (#53159) 2021-07-19 06:54:38 -07:00
Tobias Sauerwein cb0a7589ce
Use class properties in netatmo (#52705) 2021-07-08 09:30:54 +02:00
Tobias Sauerwein 7291228e16
Remove boilerplate code in favour of attributes in Netatmo integration (#52395)
* Make use of attributes

* Add suggestions

* Update homeassistant/components/netatmo/sensor.py

Co-authored-by: Daniel Hjelseth Høyer <mail@dahoiv.net>

* Update homeassistant/components/netatmo/sensor.py

Co-authored-by: Daniel Hjelseth Høyer <mail@dahoiv.net>

Co-authored-by: Daniel Hjelseth Høyer <mail@dahoiv.net>
2021-07-02 11:36:37 +02:00
Tobias Sauerwein 14d3286b21
Clean up netatmo sensor data processing (#52403) 2021-07-02 10:08:54 +02:00
Tobias Sauerwein d975f9eb0a
Fix Netatmo sensor logic (#51338) 2021-06-01 17:58:25 +02:00
Tobias Sauerwein 9bd74961f0
Fix unnecessary API calls in Netatmo (#51260) 2021-05-30 20:55:45 -07:00
Tobias Sauerwein ac922916c1
Fix Netatmo sensor initialization (#51195) 2021-05-28 13:36:22 +02:00
Tobias Sauerwein ceec871340
Make Netatmo use async pyatmo (#49717)
* Split initialization from data retrival

* Await class initialization

* Async camera

* More async

* Remove stale code

* Clean up

* Update tests

* Fix test

* Improve error handling

* Bump pyatmo version to 5.0.0

* Add tests

* Add cloudhook test

* Increase coverage

* Add test with no camera devices

* Add test for ApiError

* Add test for timeout

* Clean up

* Catch pyatmo ApiError

* Fix PublicData

* Fix media source bug

* Increase coverage for light

* Test webhook with delayed start

* Increase coverage

* Clean up leftover data classes

* Make nonprivate

* Review comments

* Clean up stale code

* Increase cov

* Clean up code

* Code clean up

* Revert delay

* Update homeassistant/components/netatmo/climate.py

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

* Update homeassistant/components/netatmo/sensor.py

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

* Address comment

* Raise cov

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-05-20 14:59:19 +02:00
J. Nick Koston 3fa8ffa731
Enable mccabe complexity checks in flake8 (#49616)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-04-25 12:38:40 +02:00
Tobias Sauerwein 0d699bb768
Add tests for Netatmo sensor (#46393)
* Add tests for Netatmo sensor

* Fix coveragerc

* Remove freezegun dependency

* Use f-strings instead of string concatenation

* Update tests/components/netatmo/test_sensor.py

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

* Address comment on config options test

* Replace deprecated call to async_get_registry()

* Fix public weather sensor update test

* Clean up

* Prevent division by zero

Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-03-24 07:17:51 +01:00
Erik Montnemery c900e3030b
Migrate integrations n-q to extend SensorEntity (#48214) 2021-03-22 19:46:46 +01:00
Erik Montnemery 14a59d290a
Update integrations j-o to override extra_state_attributes() (#47758) 2021-03-11 20:11:25 +01:00
Mick Vleeshouwer 461e766a93
Add device class CO2 to various integrations (#47676)
* Add device class CO2 to Fibaro

* Add device class CO2 to Awair

* Add device class CO2 to Tasmota

* Add device class CO2 to Netatmo

* Add device class CO2 to Ambient Station

* Update Tasmota tests

* Remove icon
2021-03-10 12:52:55 +01:00
Tobias Sauerwein b3c33fc1be
Fix issue at Netatmo startup (#47452) 2021-03-05 21:41:55 +01:00
cgtobi f16ccae78b
Fix Netatmo public weather sensor bug (#42858) 2020-11-05 14:16:51 +01:00
cgtobi d13402108b
Add unit of measurement to Netatmo sensors (#42208)
* Add unit of measurement

* Update homeassistant/components/netatmo/sensor.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update sensor.py

* Update sensor.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>
2020-10-24 14:43:54 -05:00
cgtobi c052c261d5
Add Netatmo sensor enable default (#41928) 2020-10-22 10:01:43 +02:00
cgtobi 9dcc769a4a
Remove max and min temperature sensors (#41859) 2020-10-15 09:24:20 +02:00
J. Nick Koston da2f9db62e
Fix async functions accidentally marked as callbacks (#41607) 2020-10-10 16:54:36 +02:00
cgtobi 96035eb052
Fix missing weather sensors (#41540) 2020-10-09 12:34:52 +02:00
cgtobi 05765f1700
Remove Netatmo unnecessary battery sensors (#41321) 2020-10-07 15:25:11 +02:00
cgtobi 6065ab118f
Add Netatmo weather trend sensors (#41318)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-10-06 15:25:12 +02:00
cgtobi dcf0f9d3f3
Fix Netatmo wind angle (#41324) 2020-10-06 14:43:30 +02:00
cgtobi d7890f35be
Fix Netatmo rain sensor naming (#41326) 2020-10-06 14:42:50 +02:00
springstan 06a133c3e9
Add and use length millimeters constant (#40116)
* Add and use length millimeters constant

* Fix pylint error

* Fix broken accuweather sensor test
2020-09-22 21:09:17 -05:00
springstan d2b1918e9c
Drop UNIT_ prefix for percentage constant (#39383) 2020-09-05 21:09:14 +02:00
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
cgtobi afa2d268f2
Improve Netatmo sensor naming (#38957) 2020-08-17 09:39:09 +02:00
cgtobi 72472cd11f
Remove superfluous netatmo icons (#38859) 2020-08-13 20:39:17 -05:00
cgtobi 3957337b9f
Cleanup Netatmo sensors (#38627) 2020-08-13 09:36:47 +02:00
cgtobi 31dbdff3c4
Add Netatmo data handler (#35571)
* Fix webhook registration

* Only load camera platform with valid scope

* Add initial data handler and netatmo base class

* Update camera to use data handler

* Update init

* Parallelize API calls

* Remove cruft

* Minor tweaks

* Refactor data handler

* Update climate to use data handler

* Fix pylint error

* Fix climate update not getting fresh data

* Update climate data

* update to pyatmo 4.0.0

* Refactor for pyatmo 4.0.0

* Exclude from coverage until tests are written

* Fix typo

* Reduce parallel calls

* Add heating request attr

* Async get_entities

* Undo parallel updates

* Fix camera issue

* Introduce individual scan interval per device class

* Some cleanup

* Add basic webhook support for climate to improve responsiveness

* Replace ClimateDevice by ClimateEntity

* Add support for turning camera on/off

* Update camera state upon webhook events

* Guard data class registration with lock

* Capture errors

* Add light platform

* Add dis-/connect handling

* Fix set schedule service

* Remove extra calls

* Add service to set person(s) home/away

* Add service descriptions

* Improve service descriptions

* Use LightEntity instead of Light

* Add guard if no data is retrieved

* Make services entity based

* Only raise platform not ready if there is a NOC

* Register webhook even during runtime

* Fix turning off event

* Fix linter error

* Fix linter error

* Exclude light platform from coverage

* Change log level

* Refactor public weather sensor to use data handler

* Prevent too short coordinates

* Ignore modules without _id

* Code cleanup

* Fix test

* Exit early if no home data is retrieved

* Prevent discovery if already active

* Add services to (un-)register webhook

* Fix tests

* Not actually a coroutine

* Move methods to base class

* Address pylint comment

* Address pylint complaints

* Address comments

* Address more comments

* Add docstring

* Use single instance allowed

* Extract method

* Remove cruft

* Write state directly

* Fix test

* Add file to coverage

* Move nested function

* Move nested function

* Update docstring

* Clean up code

* Fix webhook bug

* Clean up listeners

* Use deque

* Clean up prints

* Update homeassistant/components/netatmo/sensor.py

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

* Update homeassistant/components/netatmo/sensor.py

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

* Update homeassistant/components/netatmo/sensor.py

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

* Update homeassistant/components/netatmo/sensor.py

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

* Update homeassistant/components/netatmo/sensor.py

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

* Update homeassistant/components/netatmo/sensor.py

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

* Update homeassistant/components/netatmo/camera.py

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

* Update homeassistant/components/netatmo/camera.py

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

* Update homeassistant/components/netatmo/camera.py

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

* Update homeassistant/components/netatmo/camera.py

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

* Update homeassistant/components/netatmo/camera.py

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

* Update homeassistant/components/netatmo/camera.py

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

* Rename data_class variable

* Break when match

* Extract method

* Extract methods

* Rename variable

* Improve comment

* Some refinements

* Extra

* Extract method

* Simplify code

* Improve reability

* Code simplification

* Simplify code

* Simplify code

* Code cleanup

* Fix import

* Clean up

* Clean up magic strings

* Replace data_class_name with CAMERA_DATA_CLASS_NAME

* Replace data_class_name with CAMERA_DATA_CLASS_NAME

* Replace data_class_name with HOMEDATA_DATA_CLASS_NAME

* Replace data_class_name in public weather sensor

* Clean up

* Remove deprecated config options

* Schedule immediate update on camera reconnect

* Use UUID to clearly identify public weather areas

* Use subscription mode

* Move clean up of temporary data classes

* Delay data class removal

* Fix linter complaints

* Adjust test

* Only setup lights if webhook are registered

* Prevent crash with old config entries

* Don't cache home ids

* Remove stale code

* Fix coordinates if entered mixed up by the user

* Move nested function

* Add test case for swapped coordinates

* Only wait for discovery entries

* Only use what I need

* Bring stuff closer to where it's used

* Auto clean up setup data classes

* Code cleanup

* Remove unneccessary lock

* Update homeassistant/components/netatmo/sensor.py

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

* Update tests/components/netatmo/test_config_flow.py

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

* Clean up dead code

* Fix formating

* Extend coverage

* Extend coverage

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-08-04 20:46:46 +02:00
cgtobi baa7bb69b3
Fix unavailable when value is zero (#37918) 2020-07-17 00:28:49 +02:00
Bram Kragten 9ecaa10e51
Adjust icons for MDI bump (#37730) 2020-07-14 22:17:14 +02:00
cgtobi 155a5f7c26
Add back Netatmo public weather sensors (#34401)
* Add public weather sensors back in

* Remove stale code

* Cleanup after before adding entities

* Fix pylint complaint

* Add test for options flow

* Change mode to listbox

* Update .coveragerc

* Address comments

* Don't process empty list

* Address comment

* Fix mistake

* Make signal unique

* Make string more unique

* Fix merge conflict
2020-07-09 06:39:33 +02:00
Franck Nijhof 53545c984b
Log lines do not end with a full stop (#37527) 2020-07-05 23:04:19 +02:00
cgtobi d53cb951e7
Fix zero value state rendering sensor unavailable (#34694)
Co-Authored-By: Franck Nijhof <git@frenck.dev>
2020-04-25 22:15:31 +02:00