Commit Graph

35 Commits (352987db7e0a58c439f95278046f394ee8f1b2ff)

Author SHA1 Message Date
epenet 99335a07e5
Use start_reauth helper method in integration tests (e-g) (#124785)
* Use start_reauth helper method in integration tests (e-g)

* Include fireservicerota
2024-08-28 15:47:57 +02:00
wittypluck 766733b3b2
Avoid Exception on Glances missing key (#114628)
* Handle case of sensors removed server side

* Update available state on value update

* Set uptime to None if key is missing

* Replace _attr_available by _data_valid
2024-08-11 19:14:43 +02:00
wittypluck 0c37a065ad
Add support for Glances v4 (#117664) 2024-05-21 16:21:36 +02:00
wittypluck 63d43a9384
Add Glances network sensors (#114546)
* Add Glances network sensors

* Add unit test for network and remove unused MOCK_DATA

* Add network icons
2024-04-07 16:01:00 +02:00
fhoekstra e4fbe539aa
Add GPU sensor to Glances (#106322)
* feat: add GPU sensor to Glances

* Add translations to Glances GPU sensor

* Fix translations of GPU processor and memory usage

* PR feedback: move icons to icons.json

thanks to @wittypluck

* Update glances snapshot with added GPU

* Remove JSON trailing comma

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

* Limit precision of Glance GPU mem usage sensor

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

* Clean up outdated snapshots

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-04-07 15:05:22 +02:00
wittypluck 3ef2c464ac
Add Glances DiskIO read/write sensors (#114933) 2024-04-07 00:13:02 +02:00
epenet 0b01326f9f
Use is in ConfigEntryState enum comparison in tests (A-M) (#114925) 2024-04-05 17:16:55 +02:00
Joost Lekkerkerker 906d3198e3
Use is in enum comparison in config flow tests F-J (#114670)
* Use right enum expression F-J

* Fix
2024-04-02 23:01:37 +02:00
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
Erik Montnemery 426f73b1f4
Add State.last_reported (#113511)
* Add State.last_reported

* Update tests

* Update test snapshots

* Call state_reported listeners when firing state_changed event

* Add tests
2024-03-20 21:05:07 +01:00
Marc Mueller c88b337600
Add empty line after module docstring [tests f-k] (#112709) 2024-03-08 14:50:04 +01:00
Joost Lekkerkerker 3077039470
Add icon translations to Glances (#111615)
* Add icon translations to Glances

* Add icon translations to Glances
2024-02-28 08:49:47 +01:00
wittypluck 716d8f8a00
Fix Glances translation keys on CPU load, Memory use, Swap use (#111401)
Fix translation keys on CPU load, Memory use, Swap use
2024-02-25 21:25:28 +01:00
Franck Nijhof e0a9dcd996
Add label registry (#110821) 2024-02-19 11:59:08 +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 2331f89936
Issue warning if glances server version is 2 (#105887)
* Issue warning if glances server version is 2

* Auto detect api version

* Apply suggestions

* Add HA version deprecation

* Apply suggestions from code review

* update config flow tests

* Fix breaks in ha version

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-01-04 05:17:43 +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
Rami Mosleh 785b46af22
Add re-auth flow to glances integration (#100929)
* Add reauth flow to glances integration.

* add reauth string

* add reauth strings
2023-09-26 17:46:12 +02:00
Rami Mosleh 31e9ca0099
Handle authorization error in glances config flow (#100866)
* Handle authroization error in glances config flow

* Remove validate_input method and expections

* update tests
2023-09-26 14:51:04 +02:00
Rami Mosleh ca44242095
Allow glances entries with same IP but different ports (#99536) 2023-09-03 19:22:59 +02: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
Rami Mosleh 328eda044a
Use DataUpdateCoordinator for glances (#72748)
* use DataUpdateCoordinator for glances

add tests to increase coverage

fix test_config_flow.py

fix codecov/patch

remove unused const, minor tweaks

remove invalid_auth test as it is not implemented

fix type hints

* change to async_forward_entry_setups

* Use Dataupdatecoordinator for glances

* minor fixex

* minor fixes

* minor fix

* remove support_versions const

* coe cleanup

* address comments

* fix sensor native_value

* Rename entry to entry_data in `get_api`

* Remove whitespace in sensor name
2022-11-03 10:02:25 +01:00
Rami Mosleh b303c8e040
Refactor version key in `glances` (#77541)
* update version key

* Fix merge mistake

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-08-31 12:52:52 +02:00
epenet 9cdb7bba4c
Fix glances config-flow flaky test (#77549) 2022-08-30 11:57:42 -05:00
Rami Mosleh 86b968bf79
Migrate Glances to new entity naming style (#76651)
* Migrate Glances to new entity naming style

* minor fixes
2022-08-12 09:50:27 +02:00
Franck Nijhof 7cd68381f1
Search/replace RESULT_TYPE_* by FlowResultType enum (#74642) 2022-07-07 19:57:36 +03:00
Erik Montnemery 39bc127dd6
Prevent 3rd party lib from opening sockets in glances tests (#56345) 2021-09-17 22:22:44 -10:00
Ville Skyttä 153d6e891e
Use config_entries.SOURCE_* constants (#49631) 2021-04-25 11:27:40 +02:00
Rami Mosleh c66106ee98
Add Glances sensors dynamically (#28639)
* Add temp_sensors to glances dynamically

* unsub from updates when sensor is disabled

* dynamicall add sensors

* change "device_name" to "mnt_point"

* remove unnecessary logging

* update sensor.py

* update test_config_flow.py

* remove commented code
2020-02-10 15:02:14 -08:00
Rami Mosleh 09f9875ccf Glances config flow (#27221)
* Glances Integration with config flow

* Glances Integration with config flow

* fix description texts

* Glances Integration with config flow

* Glances Integration with config flow

* fix description texts

* update .coverage.py

* add codeowner

* add test_options

* Fixed typos, Added import, fixed tests

* sort imports

* remove commented code
2019-10-21 10:17:21 +02:00