@@ -78,15 +78,21 @@ class _ComponentStreamStatus:
7878@dataclass
7979class _BlockingStatus :
8080 min_duration_sec : float
81+ """The minimum blocking duration (in seconds)."""
82+
8183 max_duration_sec : float
84+ """The maximum blocking duration (in seconds)."""
8285
8386 def __post_init__ (self ) -> None :
8487 assert self .min_duration_sec <= self .max_duration_sec , (
8588 f"Minimum blocking duration ({ self .min_duration_sec } ) cannot be greater "
8689 f"than maximum blocking duration ({ self .max_duration_sec } )"
8790 )
8891 self .last_blocking_duration_sec : float = self .min_duration_sec
92+ """Last blocking duration (in seconds).""" # pylint: disable=pointless-string-statement
93+
8994 self .blocked_until : Optional [datetime ] = None
95+ """Until when battery is blocked.""" # pylint: disable=pointless-string-statement
9096
9197 def block (self ) -> float :
9298 """Block battery.
@@ -147,21 +153,34 @@ class BatteryStatusTracker:
147153 Status updates are sent out only when there is a status change.
148154 """
149155
150- # Class attributes
151156 _battery_valid_relay : Set [BatteryRelayState .ValueType ] = {
152157 BatteryRelayState .RELAY_STATE_CLOSED
153158 }
159+ """The list of valid relay states of a battery.
160+
161+ A working battery in any other battery relay state will be reported as failing.
162+ """
163+
154164 _battery_valid_state : Set [BatteryComponentState .ValueType ] = {
155165 BatteryComponentState .COMPONENT_STATE_IDLE ,
156166 BatteryComponentState .COMPONENT_STATE_CHARGING ,
157167 BatteryComponentState .COMPONENT_STATE_DISCHARGING ,
158168 }
169+ """The list of valid states of a battery.
170+
171+ A working battery in any other battery state will be reported as failing.
172+ """
173+
159174 _inverter_valid_state : Set [InverterComponentState .ValueType ] = {
160175 InverterComponentState .COMPONENT_STATE_STANDBY ,
161176 InverterComponentState .COMPONENT_STATE_IDLE ,
162177 InverterComponentState .COMPONENT_STATE_CHARGING ,
163178 InverterComponentState .COMPONENT_STATE_DISCHARGING ,
164179 }
180+ """The list of valid states of an inverter.
181+
182+ A working inverter in any other inverter state will be reported as failing.
183+ """
165184
166185 def __init__ ( # pylint: disable=too-many-arguments
167186 self ,
0 commit comments