mirror of
https://github.com/home-assistant/core.git
synced 2025-09-10 15:21:38 +02:00
Ignore MQTT vacuum battery warning (#150211)
This commit is contained in:
@@ -79,7 +79,10 @@ DEFAULT_NAME = "Vacuum cleaner robot"
|
|||||||
_DEPRECATED_STATE_IDLE = DeprecatedConstantEnum(VacuumActivity.IDLE, "2026.1")
|
_DEPRECATED_STATE_IDLE = DeprecatedConstantEnum(VacuumActivity.IDLE, "2026.1")
|
||||||
_DEPRECATED_STATE_PAUSED = DeprecatedConstantEnum(VacuumActivity.PAUSED, "2026.1")
|
_DEPRECATED_STATE_PAUSED = DeprecatedConstantEnum(VacuumActivity.PAUSED, "2026.1")
|
||||||
|
|
||||||
_BATTERY_DEPRECATION_IGNORED_PLATFORMS = ("template",)
|
_BATTERY_DEPRECATION_IGNORED_PLATFORMS = (
|
||||||
|
"mqtt",
|
||||||
|
"template",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class VacuumEntityFeature(IntFlag):
|
class VacuumEntityFeature(IntFlag):
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
import json
|
import json
|
||||||
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
@@ -395,6 +396,15 @@ async def test_status_with_deprecated_battery_feature(
|
|||||||
assert issue.issue_domain == "vacuum"
|
assert issue.issue_domain == "vacuum"
|
||||||
assert issue.translation_key == "deprecated_vacuum_battery_feature"
|
assert issue.translation_key == "deprecated_vacuum_battery_feature"
|
||||||
assert issue.translation_placeholders == {"entity_id": "vacuum.mqtttest"}
|
assert issue.translation_placeholders == {"entity_id": "vacuum.mqtttest"}
|
||||||
|
assert not [
|
||||||
|
record
|
||||||
|
for record in caplog.records
|
||||||
|
if record.name == "homeassistant.helpers.frame"
|
||||||
|
and record.levelno >= logging.WARNING
|
||||||
|
]
|
||||||
|
assert (
|
||||||
|
"mqtt' is setting the battery_level which has been deprecated"
|
||||||
|
) not in caplog.text
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
|
Reference in New Issue
Block a user