mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Move MQTT platforms under the component (#20050)
* Move MQTT platforms under the component
This commit is contained in:
parent
5fd1053a38
commit
5b53bd6aa0
@ -5,7 +5,7 @@ from unittest.mock import ANY
|
||||
|
||||
from homeassistant.components import cover, mqtt
|
||||
from homeassistant.components.cover import (ATTR_POSITION, ATTR_TILT_POSITION)
|
||||
from homeassistant.components.cover.mqtt import MqttCover
|
||||
from homeassistant.components.mqtt.cover import MqttCover
|
||||
from homeassistant.components.mqtt.discovery import async_start
|
||||
from homeassistant.const import (
|
||||
ATTR_ASSUMED_STATE, ATTR_ENTITY_ID,
|
@ -268,7 +268,7 @@ class TestSensorMQTT(unittest.TestCase):
|
||||
assert '100' == \
|
||||
state.attributes.get('val')
|
||||
|
||||
@patch('homeassistant.components.sensor.mqtt._LOGGER')
|
||||
@patch('homeassistant.components.mqtt.sensor._LOGGER')
|
||||
def test_update_with_json_attrs_not_dict(self, mock_logger):
|
||||
"""Test attributes get extracted from a JSON result."""
|
||||
mock_component(self.hass, 'mqtt')
|
||||
@ -289,7 +289,7 @@ class TestSensorMQTT(unittest.TestCase):
|
||||
assert state.attributes.get('val') is None
|
||||
assert mock_logger.warning.called
|
||||
|
||||
@patch('homeassistant.components.sensor.mqtt._LOGGER')
|
||||
@patch('homeassistant.components.mqtt.sensor._LOGGER')
|
||||
def test_update_with_json_attrs_bad_JSON(self, mock_logger):
|
||||
"""Test attributes get extracted from a JSON result."""
|
||||
mock_component(self.hass, 'mqtt')
|
@ -8,8 +8,9 @@ from homeassistant.const import (
|
||||
from homeassistant.components import vacuum, mqtt
|
||||
from homeassistant.components.vacuum import (
|
||||
ATTR_BATTERY_LEVEL, ATTR_BATTERY_ICON, ATTR_STATUS,
|
||||
ATTR_FAN_SPEED, mqtt as mqttvacuum)
|
||||
from homeassistant.components.mqtt import CONF_COMMAND_TOPIC
|
||||
ATTR_FAN_SPEED)
|
||||
from homeassistant.components.mqtt import (
|
||||
CONF_COMMAND_TOPIC, vacuum as mqttvacuum)
|
||||
from homeassistant.components.mqtt.discovery import async_start
|
||||
from tests.common import (
|
||||
async_mock_mqtt_component,
|
Loading…
x
Reference in New Issue
Block a user