Commit Graph

10 Commits (092cdcfe91611a368eb305dd2b64fc5101cdbeaa)

Author SHA1 Message Date
wittypluck 7919ca63d0
Add uptime sensor to Glances (#111402)
* Add uptime sensor to Glances

* Merge upstream

* Merge upstream

* Fix coverage

* Add uptime sensor to Glances

* Merge upstream

* Merge upstream

* Fix coverage

* Move most uptime specific code to DataUpdateCoordinator

* Add last_reported after merge with upstream

* Add unit tests for uptime sensor

* Add unit tests for uptime sensor

* Add unit tests for uptime sensor

* Add unit tests for uptime sensor

* Move update code out of getter native_value()

* Add unit tests for uptime sensor

* Update uptime method signatures

* Set uptime icon in icons.json

* Use freezer.tick for uptime tests

* Frozen time test fails on github

* Add MIN_UPTIME_VARIATION const value

* Only update uptime on startup or when remote server restarts

* Fix for 0 values

* Set value to None to set state to Unknown if key is not found

* Add unit test for uptime change

* Code reduction

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2024-03-31 20:04:39 +02:00
Marc Mueller c88b337600
Add empty line after module docstring [tests f-k] (#112709) 2024-03-08 14:50:04 +01:00
Joost Lekkerkerker 965499dd90
Add entity translations to Glances (#107189) 2024-01-14 11:12:30 +01:00
Joost Lekkerkerker 8b1db37a85
Use snapshots in Glances sensor tests (#107159)
* Use snapshots in Glances sensor tests

* yes
2024-01-04 21:32:31 +01:00
Rami Mosleh f71e01f652
Improve glances tests (#106402) 2023-12-27 12:55:10 +01:00
Jan-Philipp Benecke 04a497343d
Update f-g* tests to use entity & device registry fixtures (#103841) 2023-11-12 13:07:38 +01:00
Dominik 239f5fe56b
Fix glances raid plugin data (#94597)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-06-23 14:36:43 +02:00
Dominik f6d3b0618e
Glances: Add error handling for invalid sensor data (#93542)
* Set sensor to Unavailable
when native_value is invalid

* Add unit tests for sensors
2023-05-30 21:35:33 -04:00
epenet 6836e15d98
Add type hints to tests (#92477) 2023-05-04 11:25:35 +02:00
Rami Mosleh 8cbe394028
Use `get_ha_sensor_data` method to update glances sensors (#83983)
* Use `get_ha_sensor_data` method to update sensor state

* update tests

* Use `get_ha_sensor_data` to validate connection

* Update test_sensor.py

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-03-31 14:27:37 +02:00