Commit Graph

29 Commits (faf5c2eb40df5fbd11f6a7d7a8ad40f52f09216a)

Author SHA1 Message Date
ollo69 827501659c
Nut: Use coordinator data, code cleanup and add test coverage (#57643) 2021-10-13 16:05:06 -10:00
ollo69 b54fc0229d
Use entity_registry_enabled_default for Nut sensors (#56854) 2021-10-13 11:33:03 -10:00
Michael b11db0b1d7
Remove unnecessary extra attribute from NUT sensors (#56078) 2021-09-10 19:17:46 -07:00
Michael 9e2945680e
Address late review of nut integration (#54606)
* remove defaults from SensorEntityDescription

* use _attr_unique_id  instead of unique_id()

* check if unique_id is not None
2021-08-15 18:32:01 -05:00
Erik Montnemery 103e21c278
Move temperature conversions to sensor base class (5/8) (#54475) 2021-08-12 13:26:17 +02:00
Michael 6285c7775b
Use SensorEntityDescription and set state class measurement for NUT sensors (#54269) 2021-08-11 08:56:41 -05:00
Franck Nijhof 38d095aa18
Define entity attributes as entity class variables (#50925)
* Define entity attributes as entity class variables

* Example coronavirus integration

* Example verisure

* Cleanup/typing fixes

* Fix Coronavirus

* Revert "Fix Coronavirus"

This reverts commit 060843860f.

* Revert "Cleanup/typing fixes"

This reverts commit 659b79e75a.

* Define entity attributes as entity class variables (attr alternative)

* Example coronavirus

* Example nut

* Example verisure

* Mark private

* Cleanup after all reverting/cherrypicking/merging

* Implement all entity properties

* Update coronavirus example

* Update nut example

* Update verisure example

* Lets not talk about this one...

* Fix multiple class attribute
2021-05-22 09:13:50 -07: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
Michael da1808226e
change log level to info (#46823) 2021-02-20 08:42:37 -10:00
J. Nick Koston c621c0fa5d
Remove YAML support from nut (#45276) 2021-01-18 15:16:42 +01:00
J. Nick Koston 2525d319a3
Update nut to use CoordinatorEntity (#39394) 2020-08-30 14:40:26 +02:00
J. Nick Koston 50105eed74
Handle UPS disconnects in NUT (#35758) 2020-05-18 16:23:05 +02:00
J. Nick Koston c8aa55439f
Undo NUT update listener on config reload (#33986) 2020-04-11 00:55:33 +02:00
J. Nick Koston 8be7cb4539
Update nut to use DataUpdateCoordinator (#33831)
* Convert nut to use DataUpdateCoordinator

* Adjust per review

* ups_list is a dict with {id: name, ...}
2020-04-08 18:26:10 -07:00
J. Nick Koston 7383e81609
Convert nut to a multi step config flow (#33803)
* Convert nut to a multi step config flow

* Users can now choose the ups they want in
step 2 (or skipped if only one)

* Users can now select the resources they want
to monitor based on what is actually available
on the device

* CONF_NAME has been removed as we now get the
name from NUT

* Device classes have been added which allows
the battery charge state to be seen in the
devices UI

* Remove update_interval as its for a followup PR

* explict

* reduce

* fix bug, add tests for options flow

* Test for dupe import

* Test for dupe import

* Call step directly

* Update homeassistant/components/nut/config_flow.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-08 11:45:45 -05:00
springstan eae21be5b9
Improve string formatting v6 (#33698) 2020-04-07 23:14:28 +02:00
J. Nick Koston cc443ff37a
Add config flow for nut (#33457)
* Convert nut to config flow

* Add a test for importing

* lint

* Address review items (part 1)

* Address review items (part 1)

* Cleanup unique id handling

* Update tests for new naming scheme

* No unique id, no device_info

* Remove sensor types

* Update tests to use resources that still exist
2020-03-31 19:08:27 -07:00
J. Nick Koston d59209ff47
Prevent nut from doing I/O in the event loop (#33420)
* Prevent nut from doing I/O in the event loop

device_state_attributes would call for an update if the
throttle happened to expire.

* _format_display_state no self use
2020-03-29 20:53:25 -05:00
Jonas Kohlbrenner 57820be92a
Add scan_interval support for NUT integration (#31167)
* Added scan_interval support

* Changed to config[key] for required keys and optional keys with default value

* Removed usage of Throttle
2020-03-21 16:45:10 +01:00
springstan f1a0ca7cd3
Add and use percentage constant (#32094)
* Add and use percentage constant

* Fix pylint error and broken test
2020-02-28 11:46:48 -08:00
springstan a85808e325
Add and use time related constants (#32065)
* Add and use time related constants

* Sort time constants and reuse them in data rate constants

* Fix greeneyemonitor import

* Fix greeneyemonitor import V2

* Fix failing here_travel_time test

* Add TIME_MONTHS and TIME_YEARS

* Use TIME_MINUTES in opentherm_gw and isy994

* Add and use TIME_MILLISECONDS

* Change inconsistent ones

* Add TIME_MICROSECONDS and TIME_WEEKS

* Use constants in apcupsd and travisci

* Fix import error in upnp sensor.py

* Fix isy994 sensor.py using TIME_YEARS

* Fix dyson tests

* Use TIME_SECONDS in more places

* Use TIME_DAYS in google wifi
2020-02-23 22:09:24 +02:00
Ville Skyttä e6388e186c
Remove unnecessary string literal concatenations (#30360) 2020-01-02 21:17:10 +02:00
springstan 655780447c Move imports to top for nut (#29368) 2019-12-03 18:19:43 -05:00
Brett T. Warden 1012215709 Match ALARM in NUT UPS status message (#28591)
If ups.status contains "ALARM", add "Alarm" to virtual sensor ups.status.display.

Fixes #28580
2019-11-07 15:03:32 -07:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
cgtobi 2c07bfb9e0 Remove dependencies and requirements (#23024)
* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit fe7171b4cd.

* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit 391355ee2c.

* Remove dependencies and requirements

* Fix flake8 complaints

* Fix more flake8 complaints

* Revert non-component removals
2019-04-12 10:13:30 -07:00
Tobias Sauerwein 048b100eea Clean up docstrings (#22679)
* Clean up docstrings

* Fix long lines

* Fix more docstrings

* Fix more docstrings

* Fix more docstrings
2019-04-03 17:40:03 +02:00
Paulus Schoutsen f5076188ef
Consolidate all platforms that have no tests (#22096)
* Consolidate

* Fix tests

* Update imports

* Fix import

* Use importlib because integration and package share name

* Fix more tests

* Update .coveragerc and CODEOWNERS
2019-03-16 20:44:05 -07:00