M8-R15: fix HA discovery identities and thermal totals
frontend / frontend (push) Successful in 47s
pytest / test (push) Successful in 4m1s
docker-image / build-and-push (push) Successful in 1m38s

This commit is contained in:
2026-08-28 01:20:52 +02:00
parent 8180082f90
commit 018f13d73d
13 changed files with 1284 additions and 136 deletions
+13 -4
View File
@@ -257,7 +257,7 @@ def test_publish_passes_topic_payload_retain_to_paho() -> None:
manager._connected = True
manager._client = mock_client
manager.publish("test/topic", '{"key": "value"}', retain=True, qos=1)
assert manager.publish("test/topic", '{"key": "value"}', retain=True, qos=1) is True
mock_client.publish.assert_called_once_with(
"test/topic", payload='{"key": "value"}', qos=1, retain=True
@@ -267,8 +267,7 @@ def test_publish_passes_topic_payload_retain_to_paho() -> None:
def test_publish_is_noop_when_not_connected() -> None:
manager = MqttManager()
# No connect — should silently skip
manager.publish("topic", "payload", retain=False)
# No exception raised
assert manager.publish("topic", "payload", retain=False) is False
def test_publish_does_not_raise_on_paho_error() -> None:
@@ -279,7 +278,17 @@ def test_publish_does_not_raise_on_paho_error() -> None:
manager._connected = True
# Must not raise
manager.publish("topic", "payload")
assert manager.publish("topic", "payload") is False
def test_publish_returns_false_when_paho_rejects_message() -> None:
manager = MqttManager()
mock_client = MagicMock()
mock_client.publish.return_value.rc = 1
manager._client = mock_client
manager._connected = True
assert manager.publish("topic", "payload") is False
# ---------------------------------------------------------------------------