diff --git a/homeassistant/components/binary_sensor/command_sensor.py b/homeassistant/components/binary_sensor/command_line.py similarity index 96% rename from homeassistant/components/binary_sensor/command_sensor.py rename to homeassistant/components/binary_sensor/command_line.py index bd93ce27afa..2d58951ae74 100644 --- a/homeassistant/components/binary_sensor/command_sensor.py +++ b/homeassistant/components/binary_sensor/command_line.py @@ -9,7 +9,7 @@ import logging from datetime import timedelta from homeassistant.components.binary_sensor import BinarySensorDevice -from homeassistant.components.sensor.command_sensor import CommandSensorData +from homeassistant.components.sensor.command_line import CommandSensorData from homeassistant.const import CONF_VALUE_TEMPLATE from homeassistant.helpers import template diff --git a/homeassistant/components/rollershutter/command_rollershutter.py b/homeassistant/components/rollershutter/command_line.py similarity index 100% rename from homeassistant/components/rollershutter/command_rollershutter.py rename to homeassistant/components/rollershutter/command_line.py diff --git a/homeassistant/components/sensor/command_sensor.py b/homeassistant/components/sensor/command_line.py similarity index 100% rename from homeassistant/components/sensor/command_sensor.py rename to homeassistant/components/sensor/command_line.py diff --git a/homeassistant/components/switch/command_switch.py b/homeassistant/components/switch/command_line.py similarity index 100% rename from homeassistant/components/switch/command_switch.py rename to homeassistant/components/switch/command_line.py diff --git a/tests/components/binary_sensor/test_command_sensor.py b/tests/components/binary_sensor/test_command_line.py similarity index 80% rename from tests/components/binary_sensor/test_command_sensor.py rename to tests/components/binary_sensor/test_command_line.py index c2ec3b2f6f6..2e3dfb2795b 100644 --- a/tests/components/binary_sensor/test_command_sensor.py +++ b/tests/components/binary_sensor/test_command_line.py @@ -1,5 +1,5 @@ """ -tests.components.binary_sensor.command_sensor +tests.components.binary_sensor.command_line ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests command binary sensor. @@ -7,7 +7,7 @@ Tests command binary sensor. import unittest from homeassistant.const import (STATE_ON, STATE_OFF) -from homeassistant.components.binary_sensor import command_sensor +from homeassistant.components.binary_sensor import command_line from tests.common import get_test_home_assistant @@ -35,7 +35,7 @@ class TestCommandSensorBinarySensor(unittest.TestCase): for dev in devs: devices.append(dev) - command_sensor.setup_platform( + command_line.setup_platform( self.hass, config, add_dev_callback) self.assertEqual(1, len(devices)) @@ -54,25 +54,25 @@ class TestCommandSensorBinarySensor(unittest.TestCase): for dev in devs: devices.append(dev) - self.assertFalse(command_sensor.setup_platform( + self.assertFalse(command_line.setup_platform( self.hass, config, add_dev_callback)) self.assertEqual(0, len(devices)) def test_template(self): """ Test command sensor with template """ - data = command_sensor.CommandSensorData('echo 10') + data = command_line.CommandSensorData('echo 10') - entity = command_sensor.CommandBinarySensor( + entity = command_line.CommandBinarySensor( self.hass, data, 'test', '1.0', '0', '{{ value | multiply(0.1) }}') self.assertEqual(STATE_ON, entity.state) def test_sensor_off(self): """ Test command sensor with template """ - data = command_sensor.CommandSensorData('echo 0') + data = command_line.CommandSensorData('echo 0') - entity = command_sensor.CommandBinarySensor( + entity = command_line.CommandBinarySensor( self.hass, data, 'test', '1', '0', None) self.assertEqual(STATE_OFF, entity.state) diff --git a/tests/components/rollershutter/test_command_rollershutter.py b/tests/components/rollershutter/test_command_line.py similarity index 92% rename from tests/components/rollershutter/test_command_rollershutter.py rename to tests/components/rollershutter/test_command_line.py index 0fe74ee25ec..6f71b6f6353 100644 --- a/tests/components/rollershutter/test_command_rollershutter.py +++ b/tests/components/rollershutter/test_command_line.py @@ -1,7 +1,7 @@ """ -tests.components.rollershutter.command_rollershutter -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Tests the command_rollershutter component +tests.components.rollershutter.command_line +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Tests the command_line component """ import os @@ -12,7 +12,7 @@ from unittest import mock import homeassistant.core as ha import homeassistant.components.rollershutter as rollershutter from homeassistant.components.rollershutter import ( - command_rollershutter as cmd_rs) + command_line as cmd_rs) class TestCommandRollerShutter(unittest.TestCase): @@ -53,7 +53,7 @@ class TestCommandRollerShutter(unittest.TestCase): } self.assertTrue(rollershutter.setup(self.hass, { 'rollershutter': { - 'platform': 'command_rollershutter', + 'platform': 'command_line', 'rollershutters': { 'test': test_rollershutter } diff --git a/tests/components/sensor/test_command_sensor.py b/tests/components/sensor/test_command_line.py similarity index 82% rename from tests/components/sensor/test_command_sensor.py rename to tests/components/sensor/test_command_line.py index 17b4aab5fb3..fa51a9a1c15 100644 --- a/tests/components/sensor/test_command_sensor.py +++ b/tests/components/sensor/test_command_line.py @@ -1,12 +1,12 @@ """ -tests.components.sensor.test_command_sensor +tests.components.sensor.test_command_line ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests command sensor. """ import unittest -from homeassistant.components.sensor import command_sensor +from homeassistant.components.sensor import command_line from tests.common import get_test_home_assistant @@ -33,7 +33,7 @@ class TestCommandSensorSensor(unittest.TestCase): for dev in devs: devices.append(dev) - command_sensor.setup_platform( + command_line.setup_platform( self.hass, config, add_dev_callback) self.assertEqual(1, len(devices)) @@ -53,23 +53,23 @@ class TestCommandSensorSensor(unittest.TestCase): for dev in devs: devices.append(dev) - self.assertFalse(command_sensor.setup_platform( + self.assertFalse(command_line.setup_platform( self.hass, config, add_dev_callback)) self.assertEqual(0, len(devices)) def test_template(self): """ Test command sensor with template. """ - data = command_sensor.CommandSensorData('echo 50') + data = command_line.CommandSensorData('echo 50') - entity = command_sensor.CommandSensor( + entity = command_line.CommandSensor( self.hass, data, 'test', 'in', '{{ value | multiply(0.1) }}') self.assertEqual(5, float(entity.state)) def test_bad_command(self): """ Test bad command. """ - data = command_sensor.CommandSensorData('asdfasdf') + data = command_line.CommandSensorData('asdfasdf') data.update() self.assertEqual(None, data.value) diff --git a/tests/components/switch/test_command_switch.py b/tests/components/switch/test_command_line.py similarity index 94% rename from tests/components/switch/test_command_switch.py rename to tests/components/switch/test_command_line.py index 3aa7bfeb0c0..3a717d5d44f 100644 --- a/tests/components/switch/test_command_switch.py +++ b/tests/components/switch/test_command_line.py @@ -1,6 +1,6 @@ """ -tests.components.switch.test_command_switch -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +tests.components.switch.test_command_line +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests command switch. """ @@ -34,7 +34,7 @@ class TestCommandSwitch(unittest.TestCase): } self.assertTrue(switch.setup(self.hass, { 'switch': { - 'platform': 'command_switch', + 'platform': 'command_line', 'switches': { 'test': test_switch } @@ -67,7 +67,7 @@ class TestCommandSwitch(unittest.TestCase): } self.assertTrue(switch.setup(self.hass, { 'switch': { - 'platform': 'command_switch', + 'platform': 'command_line', 'switches': { 'test': test_switch } @@ -102,7 +102,7 @@ class TestCommandSwitch(unittest.TestCase): } self.assertTrue(switch.setup(self.hass, { 'switch': { - 'platform': 'command_switch', + 'platform': 'command_line', 'switches': { 'test': test_switch } @@ -134,7 +134,7 @@ class TestCommandSwitch(unittest.TestCase): } self.assertTrue(switch.setup(self.hass, { 'switch': { - 'platform': 'command_switch', + 'platform': 'command_line', 'switches': { 'test': test_switch }