diff --git a/homeassistant/components/mfi/sensor.py b/homeassistant/components/mfi/sensor.py index 38f6d973b9d..84f4abdaead 100644 --- a/homeassistant/components/mfi/sensor.py +++ b/homeassistant/components/mfi/sensor.py @@ -133,14 +133,14 @@ class MfiSensor(SensorEntity): try: tag = self._port.tag except ValueError: - return "State" + return None if tag == "temperature": return UnitOfTemperature.CELSIUS if tag == "active_pwr": return "Watts" if self._port.model == "Input Digital": - return "State" + return None return tag def update(self) -> None: diff --git a/tests/components/mfi/test_sensor.py b/tests/components/mfi/test_sensor.py index ea67ab6f427..f8a043eb8fb 100644 --- a/tests/components/mfi/test_sensor.py +++ b/tests/components/mfi/test_sensor.py @@ -148,7 +148,7 @@ async def test_uom_power(port, sensor): async def test_uom_digital(port, sensor): """Test the UOM digital input.""" port.model = "Input Digital" - assert sensor.unit_of_measurement == "State" + assert sensor.unit_of_measurement is None assert sensor.device_class is None @@ -162,7 +162,7 @@ async def test_uom_unknown(port, sensor): async def test_uom_uninitialized(port, sensor): """Test that the UOM defaults if not initialized.""" type(port).tag = mock.PropertyMock(side_effect=ValueError) - assert sensor.unit_of_measurement == "State" + assert sensor.unit_of_measurement is None assert sensor.device_class is None