Correct celcius to celsius (#1860)
This commit is contained in:
1 parent
9090672146
commit
2e79e9d5bb
43 files changed
+128
-109
No files matched your search
@@ -6,7 +6,7 @@ import requests
|
||||
|
||||
import homeassistant.components.sensor as sensor
|
||||
import homeassistant.components.sensor.mfi as mfi
|
||||
from homeassistant.const import TEMP_CELCIUS
|
||||
from homeassistant.const import TEMP_CELSIUS
|
||||
|
||||
from tests.common import get_test_home_assistant
|
||||
|
||||
@@ -139,7 +139,7 @@ class TestMfiSensor(unittest.TestCase):
|
||||
def test_uom_temp(self):
|
||||
"""Test the UOM temperature."""
|
||||
self.port.tag = 'temperature'
|
||||
self.assertEqual(TEMP_CELCIUS, self.sensor.unit_of_measurement)
|
||||
self.assertEqual(TEMP_CELSIUS, self.sensor.unit_of_measurement)
|
||||
|
||||
def test_uom_power(self):
|
||||
"""Test the UOEM power."""
|
||||
|
||||
@@ -3,7 +3,7 @@ import unittest
|
||||
|
||||
from homeassistant.bootstrap import _setup_component
|
||||
from homeassistant.components import rfxtrx as rfxtrx_core
|
||||
from homeassistant.const import TEMP_CELCIUS
|
||||
from homeassistant.const import TEMP_CELSIUS
|
||||
|
||||
from tests.common import get_test_home_assistant
|
||||
|
||||
@@ -44,7 +44,7 @@ class TestSensorRfxtrx(unittest.TestCase):
|
||||
print(rfxtrx_core.RFX_DEVICES)
|
||||
entity = rfxtrx_core.RFX_DEVICES['sensor_0502']
|
||||
self.assertEqual('Test', entity.name)
|
||||
self.assertEqual(TEMP_CELCIUS, entity.unit_of_measurement)
|
||||
self.assertEqual(TEMP_CELSIUS, entity.unit_of_measurement)
|
||||
self.assertEqual(14.9, entity.state)
|
||||
self.assertEqual({'Humidity status': 'normal', 'Temperature': 14.9,
|
||||
'Rssi numeric': 6, 'Humidity': 34,
|
||||
@@ -85,7 +85,7 @@ class TestSensorRfxtrx(unittest.TestCase):
|
||||
self.assertEqual('Bath_Humidity', entity.__str__())
|
||||
elif entity.name == 'Bath':
|
||||
device_num = device_num + 1
|
||||
self.assertEqual(TEMP_CELCIUS, entity.unit_of_measurement)
|
||||
self.assertEqual(TEMP_CELSIUS, entity.unit_of_measurement)
|
||||
self.assertEqual(25.5, entity.state)
|
||||
self.assertEqual({'Battery numeric': 9, 'Temperature': 25.5,
|
||||
'Humidity': 14, 'Humidity status': 'normal',
|
||||
@@ -95,7 +95,7 @@ class TestSensorRfxtrx(unittest.TestCase):
|
||||
self.assertEqual('Bath', entity.__str__())
|
||||
elif entity.name == 'Test':
|
||||
device_num = device_num + 1
|
||||
self.assertEqual(TEMP_CELCIUS, entity.unit_of_measurement)
|
||||
self.assertEqual(TEMP_CELSIUS, entity.unit_of_measurement)
|
||||
self.assertEqual(14.9, entity.state)
|
||||
self.assertEqual({'Humidity status': 'normal',
|
||||
'Temperature': 14.9,
|
||||
@@ -226,7 +226,7 @@ class TestSensorRfxtrx(unittest.TestCase):
|
||||
self.assertEqual('Bath_Humidity', entity.__str__())
|
||||
elif entity.name == 'Bath':
|
||||
device_num = device_num + 1
|
||||
self.assertEqual(TEMP_CELCIUS, entity.unit_of_measurement)
|
||||
self.assertEqual(TEMP_CELSIUS, entity.unit_of_measurement)
|
||||
self.assertEqual(25.5, entity.state)
|
||||
self.assertEqual({'Battery numeric': 9, 'Temperature': 25.5,
|
||||
'Humidity': 14, 'Humidity status': 'normal',
|
||||
@@ -236,7 +236,7 @@ class TestSensorRfxtrx(unittest.TestCase):
|
||||
self.assertEqual('Bath', entity.__str__())
|
||||
elif entity.name == 'Test':
|
||||
device_num = device_num + 1
|
||||
self.assertEqual(TEMP_CELCIUS, entity.unit_of_measurement)
|
||||
self.assertEqual(TEMP_CELSIUS, entity.unit_of_measurement)
|
||||
self.assertEqual(14.9, entity.state)
|
||||
self.assertEqual({'Humidity status': 'normal',
|
||||
'Temperature': 14.9,
|
||||
@@ -274,7 +274,7 @@ class TestSensorRfxtrx(unittest.TestCase):
|
||||
self.assertEqual('Bath_Humidity', entity.__str__())
|
||||
elif entity.name == 'Bath':
|
||||
device_num = device_num + 1
|
||||
self.assertEqual(TEMP_CELCIUS, entity.unit_of_measurement)
|
||||
self.assertEqual(TEMP_CELSIUS, entity.unit_of_measurement)
|
||||
self.assertEqual(51.1, entity.state)
|
||||
self.assertEqual({'Battery numeric': 9, 'Temperature': 51.1,
|
||||
'Humidity': 15, 'Humidity status': 'normal',
|
||||
@@ -284,7 +284,7 @@ class TestSensorRfxtrx(unittest.TestCase):
|
||||
self.assertEqual('Bath', entity.__str__())
|
||||
elif entity.name == 'Test':
|
||||
device_num = device_num + 1
|
||||
self.assertEqual(TEMP_CELCIUS, entity.unit_of_measurement)
|
||||
self.assertEqual(TEMP_CELSIUS, entity.unit_of_measurement)
|
||||
self.assertEqual(13.3, entity.state)
|
||||
self.assertEqual({'Humidity status': 'normal',
|
||||
'Temperature': 13.3,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import unittest
|
||||
|
||||
from homeassistant.const import (
|
||||
TEMP_CELCIUS,
|
||||
TEMP_CELSIUS,
|
||||
)
|
||||
from homeassistant.components import thermostat
|
||||
|
||||
@@ -18,7 +18,7 @@ class TestDemoThermostat(unittest.TestCase):
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.hass.config.temperature_unit = TEMP_CELCIUS
|
||||
self.hass.config.temperature_unit = TEMP_CELSIUS
|
||||
self.assertTrue(thermostat.setup(self.hass, {'thermostat': {
|
||||
'platform': 'demo',
|
||||
}}))
|
||||
|
||||
@@ -8,7 +8,7 @@ from homeassistant.const import (
|
||||
SERVICE_TURN_ON,
|
||||
STATE_ON,
|
||||
STATE_OFF,
|
||||
TEMP_CELCIUS,
|
||||
TEMP_CELSIUS,
|
||||
)
|
||||
from homeassistant.components import thermostat
|
||||
import homeassistant.components.thermostat.heat_control as heat_control
|
||||
@@ -48,7 +48,7 @@ class TestSetupThermostatHeatControl(unittest.TestCase):
|
||||
def test_setup_with_sensor(self):
|
||||
"""Test set up heat_control with sensor to trigger update at init."""
|
||||
self.hass.states.set(ENT_SENSOR, 22.0, {
|
||||
ATTR_UNIT_OF_MEASUREMENT: TEMP_CELCIUS
|
||||
ATTR_UNIT_OF_MEASUREMENT: TEMP_CELSIUS
|
||||
})
|
||||
thermostat.setup(self.hass, {'thermostat': {
|
||||
'platform': 'heat_control',
|
||||
@@ -58,7 +58,7 @@ class TestSetupThermostatHeatControl(unittest.TestCase):
|
||||
}})
|
||||
state = self.hass.states.get(ENTITY)
|
||||
self.assertEqual(
|
||||
TEMP_CELCIUS, state.attributes.get('unit_of_measurement'))
|
||||
TEMP_CELSIUS, state.attributes.get('unit_of_measurement'))
|
||||
self.assertEqual(22.0, state.attributes.get('current_temperature'))
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ class TestThermostatHeatControl(unittest.TestCase):
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.hass.config.temperature_unit = TEMP_CELCIUS
|
||||
self.hass.config.temperature_unit = TEMP_CELSIUS
|
||||
thermostat.setup(self.hass, {'thermostat': {
|
||||
'platform': 'heat_control',
|
||||
'name': 'test',
|
||||
@@ -182,7 +182,7 @@ class TestThermostatHeatControl(unittest.TestCase):
|
||||
self.assertEqual(SERVICE_TURN_OFF, call.service)
|
||||
self.assertEqual(ENT_SWITCH, call.data['entity_id'])
|
||||
|
||||
def _setup_sensor(self, temp, unit=TEMP_CELCIUS):
|
||||
def _setup_sensor(self, temp, unit=TEMP_CELSIUS):
|
||||
"""Setup the test sensor."""
|
||||
self.hass.states.set(ENT_SENSOR, temp, {
|
||||
ATTR_UNIT_OF_MEASUREMENT: unit
|
||||
|
||||
@@ -6,7 +6,7 @@ from unittest import mock
|
||||
import somecomfort
|
||||
|
||||
from homeassistant.const import (CONF_USERNAME, CONF_PASSWORD,
|
||||
TEMP_CELCIUS, TEMP_FAHRENHEIT)
|
||||
TEMP_CELSIUS, TEMP_FAHRENHEIT)
|
||||
import homeassistant.components.thermostat.honeywell as honeywell
|
||||
|
||||
|
||||
@@ -249,13 +249,13 @@ class TestHoneywellRound(unittest.TestCase):
|
||||
def test_attributes(self):
|
||||
"""Test the attributes."""
|
||||
self.assertEqual('House', self.round1.name)
|
||||
self.assertEqual(TEMP_CELCIUS, self.round1.unit_of_measurement)
|
||||
self.assertEqual(TEMP_CELSIUS, self.round1.unit_of_measurement)
|
||||
self.assertEqual(20, self.round1.current_temperature)
|
||||
self.assertEqual(21, self.round1.target_temperature)
|
||||
self.assertFalse(self.round1.is_away_mode_on)
|
||||
|
||||
self.assertEqual('Hot Water', self.round2.name)
|
||||
self.assertEqual(TEMP_CELCIUS, self.round2.unit_of_measurement)
|
||||
self.assertEqual(TEMP_CELSIUS, self.round2.unit_of_measurement)
|
||||
self.assertEqual(21, self.round2.current_temperature)
|
||||
self.assertEqual(None, self.round2.target_temperature)
|
||||
self.assertFalse(self.round2.is_away_mode_on)
|
||||
@@ -307,7 +307,7 @@ class TestHoneywellUS(unittest.TestCase):
|
||||
"""Test the unit of measurement."""
|
||||
self.assertEqual(TEMP_FAHRENHEIT, self.honeywell.unit_of_measurement)
|
||||
self.device.temperature_unit = 'C'
|
||||
self.assertEqual(TEMP_CELCIUS, self.honeywell.unit_of_measurement)
|
||||
self.assertEqual(TEMP_CELSIUS, self.honeywell.unit_of_measurement)
|
||||
|
||||
def test_target_temp(self):
|
||||
"""Test the target temperature."""
|
||||
|
||||
Reference in new issue
Block a user