energomera_hass_mqtt.config

Module to instantiate configuration data for EnergomeraHassMqtt class from YAML files with defaults and schema validation.

Classes

EnergomeraConfig([config_file, content])

Class representing configuration for EnergomeraHassMqtt.

class energomera_hass_mqtt.config.EnergomeraConfig(config_file=None, content=None)

Bases: object

Class representing configuration for EnergomeraHassMqtt.

Parameters:
  • config_file (str | None) – Name of configuration file

  • content (str | None) – Literal content representing the configuration

property of: ConfigSchema

Returns the configuration state

Returns:

Configuration state

property logging_level: int

Returns logging level suitable for logging library

Returns:

Logging level

interpolate()

Interpolates certain expressions in parameters section of the configuration. The method uses original configuration as read from the source, to access expressions to interpolate.

Supported expressions:

  • {{ energomera_prev_month }}: Previous month in meter’s format

  • {{ energomera_prev_day }}: Previous day in meter’s format

Return type:

None