crismc / rpi_i2c_oled

Python library to enable 128x32 pixel OLED for Raspberry Pi (both 32 and 64bit).
MIT License
16 stars 10 forks source link

[Bug]: CPU load data does not populate. It's showing 0.000.00% #4

Closed crismc closed 1 year ago

crismc commented 1 year ago

Requirements

Current Behavior

CPU load data does not populate. It's showing 0.000.00%

Expected Behavior

CPU load is expected to show the current CPU load, which isnt 0.000.00%

Steps To Reproduce

  1. Run the CPU screen on any distribution
  2. CPU screen shows 0.000.00%

Context

YAML state

Environment

- Browser:
- HA Version:
- I2C_OLED: 1.0.3

Anything else?

No response

crismc commented 1 year ago

Command being run to obtain CPU load is: top -bn1 | grep load | awk '{printf "%.2f", $(NF-2)}'

This is a typo, and should be: top -bn1 | grep Load | awk '{printf "%.2f", $(NF-2)}'