Commit graph

74 commits

Author SHA1 Message Date
G Johansson
75b0acf6b6
Remove YAML import from System monitor (#119782) 2024-06-17 09:52:25 +02:00
Marc Mueller
dc47792ff2
Update codespell to 2.3.0 (#118001) 2024-05-24 08:22:29 +02:00
Michael
59349d2859
Store runtime data inside the config entry in System Monitor (#116816)
* replace optional timeout by sane default

* SystemMonitorConfigEntry noz needed in repairs.py
2024-05-05 02:03:57 +02:00
G Johansson
7b0abb00aa
Show correct ipv6 address in System Monitor (#114024) 2024-03-23 11:24:17 +01:00
J. Nick Koston
f662e7e3cf
Only calculate native value once per update in systemmonitor (#113921) 2024-03-21 09:33:36 +01:00
Sid
6ee273a548
Clean up unneeded ruff noqa directives (#113616) 2024-03-16 09:48:37 -10:00
J. Nick Koston
1ffc459aa7
Only read cpu once during systemmonitor setup (#112863)
* Only read cpu once during systemmonitor setup

* type
2024-03-09 23:00:53 -05:00
Joost Lekkerkerker
0b4fafddbc
Add icon translations to Systemmonitor (#112300)
* Add icon translations to Systemmonitor

* Add icon translations to Systemmonitor
2024-03-05 11:52:50 +01:00
G Johansson
cdd7b94a95
Move all System Monitor updates into single Data Update Coordinator (#112055) 2024-03-03 07:24:04 -10:00
G Johansson
c45cae3665
Remove obsolete entities from System Monitor automatically (#111231)
* Remove obsolete entities from System Monitor automatically

* callback
2024-02-24 20:50:53 +01:00
G Johansson
777428c36d
Add diagnostics to System Monitor (#111291)
* Add diagnostics to System Monitor

* Fix
2024-02-24 20:11:11 +01:00
G Johansson
9e46c2e2b3
Isolate systemmonitor from psutil shared state (#111110)
* Isolate systemmonitor from psutil shared state

* Mods

* typing

* Fix tests

* Fix read temp issue

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-02-23 20:53:48 +01:00
G Johansson
7ce1ba9304
Fix cpu percentage in System Monitor (#110268)
* Fix cpu percentage in System Monitor

* Tests
2024-02-11 21:11:31 +01:00
G Johansson
1706156faf
Add Process binary sensor in System Monitor (#108585)
* Process binary sensor in System Monitor

* Add repair flow

* add issue

* add platform

* fix repair

* Tests

* Fix tests

* add minor version

* migrate

* Mod repairs

* Fix tests

* config flow test

* Last fixes

* Review comments

* Remove entities during repair

* Remove snapshot
2024-02-06 02:09:05 +01:00
Marc Mueller
3d410a1d6e
Improve systemmonitor generic typing (#108220) 2024-01-17 18:19:10 +01:00
G Johansson
d4f9ad9dd3
Create update coordinator for Systemmonitor (#106693) 2024-01-16 15:07:55 -10:00
G Johansson
0ba0f57439
Add entity name translations to System Monitor (#107952) 2024-01-16 21:39:03 +01:00
G Johansson
5b3e1306f8
Add tests for System Monitor (#107891)
* Add tests

* no coordinator

* Coverage

* processes

* test init

* util

* test icon

* Add tests

* Mod tests

* Add tests

* Test attributes

* snapshots

* icon

* test disk mounts

* fixes

* svmem

* cache_clear

* test icon

* reset icon test

* test_processor_temperature

* fix tests on macos

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-01-15 18:26:49 +01:00
G Johansson
c49246dd07
Fix duplicate unique id in System Monitor (again) (#107947)
Fix duplicate unique id in System Monitor
2024-01-13 13:48:02 +01:00
G Johansson
e715d6a7a1
Fix duplicated resource issue in System Monitor (#107671)
* Fix duplicated resource issue

* Only slug the argument
2024-01-12 08:44:38 +01:00
G Johansson
4cd1965786
Use set instead of list in Systemmonitor (#106650) 2023-12-29 13:21:08 +01:00
G Johansson
67629111f9
Systemmonitor always load imported disks (#106546)
* Systemmonitor always load legacy disks

* loaded_resources
2023-12-28 20:39:39 +01:00
G Johansson
4f0ee20ec5
Add config flow to System Monitor (#104906)
* Initial commit for config flow to System Monitor

* sensors

* Fixes

* Works

* Add import

* entity_registry_enabled_default = False

* entity_category = diagnostic

* Create issue

* issue in config flow

* Tests

* test requirement

* codeowner

* Fix names

* processes

* Fix type

* reviews

* get info during startup once

* Select process

* Legacy import of resources

* requirements

* Allow custom

* Fix tests

* strings

* strings

* Always enable process sensors

* Fix docstrings

* skip remove sensors if no sensors

* Modify sensors

* Fix tests
2023-12-26 18:29:32 +01:00
Erik Montnemery
0c2485bc03
Freeze integration entity descriptions (#105984)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-12-18 16:28:13 -10:00
Marc Mueller
8fbcffcf9f
Add types-psutil dependency (#98267) 2023-08-11 18:09:58 +02:00
Joost Lekkerkerker
e9eb8a4754
Remove stateclass from Systemmonitor process sensor (#96973)
Remove stateclass
2023-07-21 09:00:04 +02:00
Franck Nijhof
f39f3b612a
String formatting and max line length - Part 5 (#84501)
Co-authored-by: jjlawren <jjlawren@users.noreply.github.com>
2022-12-23 16:43:17 +01:00
epenet
ba043c9ebb
Use UnitOfTemperature in integrations (p-s) (#84308) 2022-12-20 18:47:27 +01:00
epenet
69bc95a715
Use DATA_SIZE device class in integrations (#83895) 2022-12-13 10:17:56 +01:00
epenet
535aba10ee
Use DataRate unit and device class in integrations (#83610) 2022-12-10 11:41:44 +01:00
Kryštof Korb
21d96e00a2
Use better icon for system monitor IP sensor (#81779) 2022-11-09 10:51:28 +01:00
Stefan Agner
650aae49fe
Support AMD SoC CPU temperature (#78472)
This adds support for CPU temperature readings on AMD SoC based systems
like the AMD G-Series GX-222G found in FUJITSU FUTRO S920.
2022-09-14 20:06:29 +03:00
Franck Nijhof
fa09cf663e
Update black to 22.1.0 (#65788) 2022-02-05 14:19:37 +01:00
Ville Skyttä
872bc456a9
Clean up no longer needed Python 3.8 support code (#65231)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-01-30 15:07:07 -06:00
epenet
eafece3651
Add setup type hints (part 1) (#63955)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-12 08:49:46 +01:00
Karthik T
bf1f8f4bfa
Fix systemmonitor CPU temp for Armbian on PineA64 (#63111) 2022-01-02 21:51:50 +01:00
epenet
071e29bf1d
Use new enums in systemmonitor (#62401)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-20 11:15:30 -05:00
Michael
a3bf56c11d
Use native datetime value in Systemmonitor sensors (#60236) 2021-11-23 21:46:31 +01:00
Michael
0da1f9544e
Correct state classes for systemmonitor sensors (#57615) 2021-10-14 08:45:58 +02:00
Michael
d661a76462
Use entity description and set state class to all System Monitor sensors (#56140) 2021-09-13 09:55:33 -10:00
Erik Montnemery
94a264afaf
Move temperature conversions to entity base class (7/8) (#54482) 2021-08-11 18:57:50 +02:00
Marc Mueller
0815eede4b
Replace lists with tuples (2) (#53685) 2021-07-30 01:20:03 +02:00
Marius
7ce4763784
change processor_temperature icon (#52256)
* change processor_temperature icon

to indicate the temperature, using "mdi:thermometer"

* add DEVICE_CLASS_TEMPERATURE,

* add None for icon

* remove Icon from Last boot

since it uses the device_class already
2021-06-29 00:39:21 +02:00
Colin Robbins
a404c138fa
Support multiple disks in systemmonitor (#50362)
* Fix #50158 - add support for multiple disks

* Rework as a tuple
2021-05-10 10:48:00 -07:00
Ruslan Sayfutdinov
786c5db5be
Use AddEntitiesCallback type, pt.4 (#49955) 2021-05-04 14:50:06 +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
Paulus Schoutsen
a90d3a051f
prefer total_seconds over seconds (#49505) 2021-04-20 17:41:36 -07:00
Phil Hollenback
e7e53b879e
Fix cpu temperature reporting for Armbian on Odroid (#48903)
Some systems expose cpu temperatures differently in
psutil. Specifically, running armbian on the Odroid xu4 sbc gives the
following temerature output:

>>> pp.pprint(psutil.sensors_temperatures())
{   'cpu0-thermal':
    [   shwtemp(label='', current=54.0, high=115.0, critical=115.0)],
    'cpu1-thermal':
    [   shwtemp(label='', current=56.0, high=115.0, critical=115.0)],
    'cpu2-thermal':
    [   shwtemp(label='', current=58.0, high=115.0, critical=115.0)],
    'cpu3-thermal':
    [   shwtemp(label='', current=56.0, high=115.0, critical=115.0)],
}

Since the cpu number is embedded inside the name, the current code
can't find it.

To fix this, check both the name and the constructed label for matches
against CPU_SENSOR_PREFIXES, and add the appropriate label
cpu0-thermal in the prefix list.

While this is slightly less efficient that just generating the label
and checking it, it results in easier to understand code.
2021-04-09 10:25:03 +02:00
Philip Allgaier
030e9d314d
Fix systemmonitor IP address look-up logic (#48740) 2021-04-06 22:58:35 +02:00
Michael
b47a90a9d8
Add AMD Ryzen processor temperatur capability to systemmonitor (#48705) 2021-04-05 17:07:22 -10:00