|
|
@@ -15,7 +15,7 @@
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
-print("nathan's version")
|
|
|
+print("nathan's version 3")
|
|
|
|
|
|
import abc
|
|
|
import argparse
|
|
|
@@ -493,13 +493,6 @@ async def _run( # pylint: disable=too-many-arguments
|
|
|
await state.publish_homeassistant_device_config(mqtt_client=mqtt_client)
|
|
|
await state.publish_preparing_for_shutdown(mqtt_client=mqtt_client)
|
|
|
try:
|
|
|
- # Clear unit/system. Prevents retained messages getting "stuck" if command changes
|
|
|
- await mqtt_client.publish(
|
|
|
- topic=state.mqtt_topic_prefix + "/unit/system/",
|
|
|
- payload="",
|
|
|
- retain=True,
|
|
|
- )
|
|
|
-
|
|
|
await mqtt_client.publish(
|
|
|
topic=state.mqtt_availability_topic,
|
|
|
payload=_MQTT_PAYLOAD_AVAILABLE,
|
|
|
@@ -518,6 +511,13 @@ async def _run( # pylint: disable=too-many-arguments
|
|
|
payload=_MQTT_PAYLOAD_NOT_AVAILABLE,
|
|
|
retain=True,
|
|
|
)
|
|
|
+
|
|
|
+ for monitored_system_unit in state.monitored_system_unit_names:
|
|
|
+ await mqtt_client.publish(
|
|
|
+ topic=state.get_system_unit_active_state_mqtt_topic(unit_name=monitored_system_unit),
|
|
|
+ payload="unknown",
|
|
|
+ retain=True,
|
|
|
+ )
|
|
|
|
|
|
|
|
|
def _main() -> None:
|