State Module

Contains definitions for managing the state and data of the Berrymon app.

class berrymon.state.State(config_path: str)[source]

Bases: object

This class represents a sate object for the Berrymon application. The state describes the current data and has functions to modify and update itself.

Variables:
  • config (Config) – The current configuration.
  • username (str) – The current username.
  • load (float) – The current CPU load in percent.
  • temp (float) – The current CPU temperature in degree celsius.
  • ip (str) – The current IP address.
  • display (I2CDisplay) – A display that can be added to the state optionally.
add_display(display: berrymon.i2c.I2CDisplay)[source]

Adds a display to the state.

Parameters:display (I2CDisplay) – The display to add.
update()[source]

Updates the state variables.