1
mirror of https://github.com/home-assistant/core synced 2024-08-02 23:40:32 +02:00
Commit Graph

53 Commits

Author SHA1 Message Date
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
Franck Nijhof
055cdc64c0
Add support for IoT class in manifest (#46935) 2021-04-15 10:21:38 +02: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
J. Nick Koston
c28d4e8e01
Clean and optimize systemmonitor (#48699)
- Remove unneeded excinfo to _LOGGER.exception
- Use f-strings
- Switch last_boot to utc
- Cache psutil/os calls used by multiple attributes in the same update cycle
2021-04-05 21:50:22 +02:00
J. Nick Koston
0544d94bd0
Update all systemmonitor sensors in one executor call (#48689)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-04-04 22:11:57 -10:00
Martin Hjelmare
fdbef90a57
Remove device class timestamp from device condition and trigger (#48431)
* Remove unit from garmin connect

* Remove unit from hvv departures

* Remove device class timestamp from device condition and trigger

* Remove unit from systemmonitor

* Use device class constant for timestamp in ring
2021-04-01 15:05:10 +02:00
Franck Nijhof
8d5ce53098
Merge of nested IF-IF cases - S-W (#48372) 2021-03-27 10:54:59 +01:00
Erik Montnemery
64bc9a8196
Migrate integrations r-s to extend SensorEntity (#48215) 2021-03-22 19:54:14 +01:00
J. Nick Koston
c820dd4cb5
Have pylint warn when user visible log messages do not start with capital letter or end with a period (#48064)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-03-19 09:26:36 -05:00
Esben Damgaard
25adc6dd4f
Don't update systemmonitor static boot time timestamp (#45165) 2021-01-21 12:35:37 +01:00
Fabian Affolter
a212248f8d
Upgrade psutil to 5.8.0 (#44640) 2020-12-30 10:22:09 +01:00
Philip Allgaier
392c058d34
Ensure consistent spelling of "ID" (#44585) 2020-12-28 18:34:08 +01:00
Philip Allgaier
b6a93724bf
Use consistent "percent" naming in systemmonitor (#41411) 2020-10-11 15:52:32 +02:00
Marius
00b3b9f183
Change Swap free mandatory arg (#41025)
to False
2020-10-03 20:55:00 +02:00
Philip Allgaier
8185ddf9a1
Add systemmonitor check for mandatory "arg" of sensors (#39687)
* Added check for mandatory "arg" of sensors

* Make pylint happy

* Moved to vol validator function for "arg" checks

* Make pylint happy once again

* Adjustments from code review
2020-09-09 12:57:24 +02:00
springstan
d2b1918e9c
Drop UNIT_ prefix for percentage constant (#39383) 2020-09-05 21:09:14 +02:00
Philip Allgaier
7be5ef8b6c
Improve systemmonitor (#36283)
* Improvements for systemmonitor

* Use MDI CPU icon (bit architecture determined at runtime)
* Consistent usages of "percent" (ensured backwards compatibility by explicity setting the entity_id)
* Default value "/" (root) for disk_* sensors to prevent runtime issues if not specified in configuration

* Added CPU temperature sensor to systemmonitor

* Code streamlining of CPU temperature retrieval

* Corrected sensor state handling and added "available" logic

* Corrected ENTITY_ID to include argument

* Optimized "available" handling & CPU temperature detection

* Corrected tuple for CPU temperature determination

* - Do not create CPU temperature entity if no sensor data can be read
- Re-use temperature sensor labels from "glances" integration

* Array fix

* Corrected sensor array access

* Handle empty temperature sensor labels (same logic as used by "glances")

* PR comments: Setting unique_ID and f-strings

* Removed unused constants

* Revert entity rename (wait until next release)
2020-09-05 05:51:18 +02:00
Fabian Affolter
73328dab5e
Upgrade psutil to 5.7.2 (#39149) 2020-08-22 18:18:05 -05:00
Paulus Schoutsen
f1d3c0d19b
Remove unused manifest fields (#33595) 2020-04-03 12:58:19 -07:00
Fabian Affolter
40fc72aac2
Upgrade psutil to 5.7.0 (#32720) 2020-03-12 11:56:07 +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
Ville Skyttä
3e23a3a860
Add and use bunch of data size and rate related constants (#31781)
Also fix a few units to match the corresponding data.
2020-02-13 08:52:57 -08:00
Franck Nijhof
22760a0bee Correct names in manifests (Q-S) (#30543) 2020-01-07 08:19:44 -05:00
Franck Nijhof
a84741392b
Format all manifests with prettier (#30521) 2020-01-06 21:28:23 +01:00
Fabian Affolter
992d9273bb Upgrade psutil to 5.6.7 (#29407) 2019-12-04 11:45:56 +01:00
Fabian Affolter
103b917bb2 Upgrade psutil to 5.6.6 (#29192) 2019-11-28 23:20:00 +01:00
Fabian Affolter
b4cec23add
Upgrade psutil to 5.6.5 (#28717) 2019-11-13 08:43:14 +01:00
Ville Skyttä
7431e26752 Round system monitor load averages to 2 decimal digits (#27558)
On a Raspberry Pi 3, Python 3.7.4:

  # python3 -c "import os; print(os.getloadavg())"
  (0.2724609375, 0.3505859375, 0.3515625)
2019-10-23 08:57:51 -07:00
Malte Franken
d337b71725 move import to top-level (#27352) 2019-10-10 00:25:21 -07:00
Franck Nijhof
c7da781efc Update documentation link URL for integrations in all manifests (#27114) 2019-10-02 09:25:44 -07:00
Tsvi Mostovicz
80136f3591 Change datetime.now() to dt_util.now() (#26582)
* Change datetime.now() to dt_util.now() in cases where the functionality should stay the same

These changes should not affect the functionality, rather cleanup our codebase.

In general we would like integrations to not to use datetime.now() unless there's a very good
reason for it, rather use our own dt_util.now() which makes the code aware of our current time
zone.

* Use datetime.utcnow() for season sensor to get offset-naive utc time

* Revert "Use datetime.utcnow() for season sensor to get offset-naive utc time"

This reverts commit 5f36463d9c7d52f8e11ffcec7e57dfbc7b21bdd1.

* BOM sensor last_updated should be UTC as well

* Run black

* Remove unused last_partition_update variable
2019-09-19 08:39:09 +02:00
Ville Skyttä
b738082dad Type check various base components (#25878)
* Type check various component base classes, disabling bunch of checks for now

* Type hint fixes

* Help mypy out some

* Add more type hints
2019-08-11 20:38:18 -07:00
Paulus Schoutsen
4de97abc3a Black 2019-07-31 12:25:30 -07:00
Fabian Affolter
cb71b4a657 Upgrade psutil to 5.6.3 (#24854) 2019-06-29 11:40:57 -04:00
Fabian Affolter
8d8d2b6de9 Upgrade psutil to 5.6.2 (#23671) 2019-05-05 00:04:04 +02: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