From 5b53bd6aa02a45ddcd4bf4358e74ddbc0285d8d3 Mon Sep 17 00:00:00 2001 From: emontnemery Date: Tue, 15 Jan 2019 17:31:06 +0100 Subject: [PATCH] Move MQTT platforms under the component (#20050) * Move MQTT platforms under the component --- .../mqtt.py => mqtt/alarm_control_panel.py} | 0 .../{binary_sensor/mqtt.py => mqtt/binary_sensor.py} | 0 homeassistant/components/{camera/mqtt.py => mqtt/camera.py} | 0 .../components/{climate/mqtt.py => mqtt/climate.py} | 0 homeassistant/components/{cover/mqtt.py => mqtt/cover.py} | 0 homeassistant/components/{fan/mqtt.py => mqtt/fan.py} | 0 .../components/{light/mqtt => mqtt/light}/__init__.py | 0 .../components/{light/mqtt => mqtt/light}/schema_basic.py | 0 .../components/{light/mqtt => mqtt/light}/schema_json.py | 0 .../components/{light/mqtt => mqtt/light}/schema_template.py | 0 homeassistant/components/{lock/mqtt.py => mqtt/lock.py} | 0 homeassistant/components/{sensor/mqtt.py => mqtt/sensor.py} | 0 homeassistant/components/{switch/mqtt.py => mqtt/switch.py} | 0 homeassistant/components/{vacuum/mqtt.py => mqtt/vacuum.py} | 0 .../test_mqtt.py => mqtt/test_alarm_control_panel.py} | 0 .../test_mqtt.py => mqtt/test_binary_sensor.py} | 0 .../components/{camera/test_mqtt.py => mqtt/test_camera.py} | 0 .../{climate/test_mqtt.py => mqtt/test_climate.py} | 0 tests/components/{cover/test_mqtt.py => mqtt/test_cover.py} | 2 +- tests/components/{fan/test_mqtt.py => mqtt/test_fan.py} | 0 tests/components/{light/test_mqtt.py => mqtt/test_light.py} | 0 .../{light/test_mqtt_json.py => mqtt/test_light_json.py} | 0 .../test_mqtt_template.py => mqtt/test_light_template.py} | 0 tests/components/{lock/test_mqtt.py => mqtt/test_lock.py} | 0 .../components/{sensor/test_mqtt.py => mqtt/test_sensor.py} | 4 ++-- .../components/{switch/test_mqtt.py => mqtt/test_switch.py} | 0 .../components/{vacuum/test_mqtt.py => mqtt/test_vacuum.py} | 5 +++-- 27 files changed, 6 insertions(+), 5 deletions(-) rename homeassistant/components/{alarm_control_panel/mqtt.py => mqtt/alarm_control_panel.py} (100%) rename homeassistant/components/{binary_sensor/mqtt.py => mqtt/binary_sensor.py} (100%) rename homeassistant/components/{camera/mqtt.py => mqtt/camera.py} (100%) rename homeassistant/components/{climate/mqtt.py => mqtt/climate.py} (100%) rename homeassistant/components/{cover/mqtt.py => mqtt/cover.py} (100%) rename homeassistant/components/{fan/mqtt.py => mqtt/fan.py} (100%) rename homeassistant/components/{light/mqtt => mqtt/light}/__init__.py (100%) rename homeassistant/components/{light/mqtt => mqtt/light}/schema_basic.py (100%) rename homeassistant/components/{light/mqtt => mqtt/light}/schema_json.py (100%) rename homeassistant/components/{light/mqtt => mqtt/light}/schema_template.py (100%) rename homeassistant/components/{lock/mqtt.py => mqtt/lock.py} (100%) rename homeassistant/components/{sensor/mqtt.py => mqtt/sensor.py} (100%) rename homeassistant/components/{switch/mqtt.py => mqtt/switch.py} (100%) rename homeassistant/components/{vacuum/mqtt.py => mqtt/vacuum.py} (100%) rename tests/components/{alarm_control_panel/test_mqtt.py => mqtt/test_alarm_control_panel.py} (100%) rename tests/components/{binary_sensor/test_mqtt.py => mqtt/test_binary_sensor.py} (100%) rename tests/components/{camera/test_mqtt.py => mqtt/test_camera.py} (100%) rename tests/components/{climate/test_mqtt.py => mqtt/test_climate.py} (100%) rename tests/components/{cover/test_mqtt.py => mqtt/test_cover.py} (99%) rename tests/components/{fan/test_mqtt.py => mqtt/test_fan.py} (100%) rename tests/components/{light/test_mqtt.py => mqtt/test_light.py} (100%) rename tests/components/{light/test_mqtt_json.py => mqtt/test_light_json.py} (100%) rename tests/components/{light/test_mqtt_template.py => mqtt/test_light_template.py} (100%) rename tests/components/{lock/test_mqtt.py => mqtt/test_lock.py} (100%) rename tests/components/{sensor/test_mqtt.py => mqtt/test_sensor.py} (99%) rename tests/components/{switch/test_mqtt.py => mqtt/test_switch.py} (100%) rename tests/components/{vacuum/test_mqtt.py => mqtt/test_vacuum.py} (99%) diff --git a/homeassistant/components/alarm_control_panel/mqtt.py b/homeassistant/components/mqtt/alarm_control_panel.py similarity index 100% rename from homeassistant/components/alarm_control_panel/mqtt.py rename to homeassistant/components/mqtt/alarm_control_panel.py diff --git a/homeassistant/components/binary_sensor/mqtt.py b/homeassistant/components/mqtt/binary_sensor.py similarity index 100% rename from homeassistant/components/binary_sensor/mqtt.py rename to homeassistant/components/mqtt/binary_sensor.py diff --git a/homeassistant/components/camera/mqtt.py b/homeassistant/components/mqtt/camera.py similarity index 100% rename from homeassistant/components/camera/mqtt.py rename to homeassistant/components/mqtt/camera.py diff --git a/homeassistant/components/climate/mqtt.py b/homeassistant/components/mqtt/climate.py similarity index 100% rename from homeassistant/components/climate/mqtt.py rename to homeassistant/components/mqtt/climate.py diff --git a/homeassistant/components/cover/mqtt.py b/homeassistant/components/mqtt/cover.py similarity index 100% rename from homeassistant/components/cover/mqtt.py rename to homeassistant/components/mqtt/cover.py diff --git a/homeassistant/components/fan/mqtt.py b/homeassistant/components/mqtt/fan.py similarity index 100% rename from homeassistant/components/fan/mqtt.py rename to homeassistant/components/mqtt/fan.py diff --git a/homeassistant/components/light/mqtt/__init__.py b/homeassistant/components/mqtt/light/__init__.py similarity index 100% rename from homeassistant/components/light/mqtt/__init__.py rename to homeassistant/components/mqtt/light/__init__.py diff --git a/homeassistant/components/light/mqtt/schema_basic.py b/homeassistant/components/mqtt/light/schema_basic.py similarity index 100% rename from homeassistant/components/light/mqtt/schema_basic.py rename to homeassistant/components/mqtt/light/schema_basic.py diff --git a/homeassistant/components/light/mqtt/schema_json.py b/homeassistant/components/mqtt/light/schema_json.py similarity index 100% rename from homeassistant/components/light/mqtt/schema_json.py rename to homeassistant/components/mqtt/light/schema_json.py diff --git a/homeassistant/components/light/mqtt/schema_template.py b/homeassistant/components/mqtt/light/schema_template.py similarity index 100% rename from homeassistant/components/light/mqtt/schema_template.py rename to homeassistant/components/mqtt/light/schema_template.py diff --git a/homeassistant/components/lock/mqtt.py b/homeassistant/components/mqtt/lock.py similarity index 100% rename from homeassistant/components/lock/mqtt.py rename to homeassistant/components/mqtt/lock.py diff --git a/homeassistant/components/sensor/mqtt.py b/homeassistant/components/mqtt/sensor.py similarity index 100% rename from homeassistant/components/sensor/mqtt.py rename to homeassistant/components/mqtt/sensor.py diff --git a/homeassistant/components/switch/mqtt.py b/homeassistant/components/mqtt/switch.py similarity index 100% rename from homeassistant/components/switch/mqtt.py rename to homeassistant/components/mqtt/switch.py diff --git a/homeassistant/components/vacuum/mqtt.py b/homeassistant/components/mqtt/vacuum.py similarity index 100% rename from homeassistant/components/vacuum/mqtt.py rename to homeassistant/components/mqtt/vacuum.py diff --git a/tests/components/alarm_control_panel/test_mqtt.py b/tests/components/mqtt/test_alarm_control_panel.py similarity index 100% rename from tests/components/alarm_control_panel/test_mqtt.py rename to tests/components/mqtt/test_alarm_control_panel.py diff --git a/tests/components/binary_sensor/test_mqtt.py b/tests/components/mqtt/test_binary_sensor.py similarity index 100% rename from tests/components/binary_sensor/test_mqtt.py rename to tests/components/mqtt/test_binary_sensor.py diff --git a/tests/components/camera/test_mqtt.py b/tests/components/mqtt/test_camera.py similarity index 100% rename from tests/components/camera/test_mqtt.py rename to tests/components/mqtt/test_camera.py diff --git a/tests/components/climate/test_mqtt.py b/tests/components/mqtt/test_climate.py similarity index 100% rename from tests/components/climate/test_mqtt.py rename to tests/components/mqtt/test_climate.py diff --git a/tests/components/cover/test_mqtt.py b/tests/components/mqtt/test_cover.py similarity index 99% rename from tests/components/cover/test_mqtt.py rename to tests/components/mqtt/test_cover.py index 1616a93d0b5..36f566d0c19 100644 --- a/tests/components/cover/test_mqtt.py +++ b/tests/components/mqtt/test_cover.py @@ -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, diff --git a/tests/components/fan/test_mqtt.py b/tests/components/mqtt/test_fan.py similarity index 100% rename from tests/components/fan/test_mqtt.py rename to tests/components/mqtt/test_fan.py diff --git a/tests/components/light/test_mqtt.py b/tests/components/mqtt/test_light.py similarity index 100% rename from tests/components/light/test_mqtt.py rename to tests/components/mqtt/test_light.py diff --git a/tests/components/light/test_mqtt_json.py b/tests/components/mqtt/test_light_json.py similarity index 100% rename from tests/components/light/test_mqtt_json.py rename to tests/components/mqtt/test_light_json.py diff --git a/tests/components/light/test_mqtt_template.py b/tests/components/mqtt/test_light_template.py similarity index 100% rename from tests/components/light/test_mqtt_template.py rename to tests/components/mqtt/test_light_template.py diff --git a/tests/components/lock/test_mqtt.py b/tests/components/mqtt/test_lock.py similarity index 100% rename from tests/components/lock/test_mqtt.py rename to tests/components/mqtt/test_lock.py diff --git a/tests/components/sensor/test_mqtt.py b/tests/components/mqtt/test_sensor.py similarity index 99% rename from tests/components/sensor/test_mqtt.py rename to tests/components/mqtt/test_sensor.py index f5eb8b23cf1..9de76ff64f4 100644 --- a/tests/components/sensor/test_mqtt.py +++ b/tests/components/mqtt/test_sensor.py @@ -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') diff --git a/tests/components/switch/test_mqtt.py b/tests/components/mqtt/test_switch.py similarity index 100% rename from tests/components/switch/test_mqtt.py rename to tests/components/mqtt/test_switch.py diff --git a/tests/components/vacuum/test_mqtt.py b/tests/components/mqtt/test_vacuum.py similarity index 99% rename from tests/components/vacuum/test_mqtt.py rename to tests/components/mqtt/test_vacuum.py index 9031034ff6e..356ce44c6cb 100644 --- a/tests/components/vacuum/test_mqtt.py +++ b/tests/components/mqtt/test_vacuum.py @@ -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,