diff --git a/homeassistant/components/vallox/__init__.py b/homeassistant/components/vallox/__init__.py index 3f441054fb1..cb9a3478839 100644 --- a/homeassistant/components/vallox/__init__.py +++ b/homeassistant/components/vallox/__init__.py @@ -7,7 +7,6 @@ import logging from typing import Any from vallox_websocket_api import PROFILE as VALLOX_PROFILE, Vallox -from vallox_websocket_api.constants import vlxDevConstants from vallox_websocket_api.exceptions import ValloxApiException import voluptuous as vol @@ -98,20 +97,11 @@ class ValloxState: def get_metric(self, metric_key: str) -> StateType: """Return cached state value.""" - _LOGGER.debug("Fetching metric key: %s", metric_key) - - if metric_key not in vlxDevConstants.__dict__: - _LOGGER.debug("Metric key invalid: %s", metric_key) if (value := self.metric_cache.get(metric_key)) is None: return None if not isinstance(value, (str, int, float)): - _LOGGER.debug( - "Return value of metric %s has unexpected type %s", - metric_key, - type(value), - ) return None return value @@ -126,8 +116,8 @@ class ValloxDataUpdateCoordinator(DataUpdateCoordinator): async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the client and boot the platforms.""" conf = config[DOMAIN] - host = conf.get(CONF_HOST) - name = conf.get(CONF_NAME) + host = conf[CONF_HOST] + name = conf[CONF_NAME] client = Vallox(host) diff --git a/homeassistant/components/vallox/fan.py b/homeassistant/components/vallox/fan.py index 39242b01b4e..4d621615aef 100644 --- a/homeassistant/components/vallox/fan.py +++ b/homeassistant/components/vallox/fan.py @@ -35,7 +35,7 @@ _LOGGER = logging.getLogger(__name__) class ExtraStateAttributeDetails(NamedTuple): - """Extra state attribute properties.""" + """Extra state attribute details.""" description: str metric_key: str diff --git a/homeassistant/components/vallox/sensor.py b/homeassistant/components/vallox/sensor.py index 0341153a9ff..0b96316b766 100644 --- a/homeassistant/components/vallox/sensor.py +++ b/homeassistant/components/vallox/sensor.py @@ -3,7 +3,6 @@ from __future__ import annotations from dataclasses import dataclass from datetime import datetime, timedelta -import logging from homeassistant.components.sensor import ( STATE_CLASS_MEASUREMENT, @@ -33,8 +32,6 @@ from .const import ( VALLOX_PROFILE_TO_STR_REPORTABLE, ) -_LOGGER = logging.getLogger(__name__) - class ValloxSensor(CoordinatorEntity, SensorEntity): """Representation of a Vallox sensor.""" @@ -59,7 +56,6 @@ class ValloxSensor(CoordinatorEntity, SensorEntity): def native_value(self) -> StateType: """Return the value reported by the sensor.""" if (metric_key := self.entity_description.metric_key) is None: - _LOGGER.debug("Error updating sensor. Empty metric key") return None return self.coordinator.data.get_metric(metric_key) @@ -100,7 +96,6 @@ class ValloxFilterRemainingSensor(ValloxSensor): super_native_value = super().native_value if not isinstance(super_native_value, (int, float)): - _LOGGER.debug("Value has unexpected type: %s", type(super_native_value)) return None # Since only a delta of days is received from the device, fix the time so the timestamp does @@ -120,11 +115,10 @@ class ValloxCellStateSensor(ValloxSensor): """Return the value reported by the sensor.""" super_native_value = super().native_value - if not isinstance(super_native_value, (int, float)): - _LOGGER.debug("Value has unexpected type: %s", type(super_native_value)) + if not isinstance(super_native_value, int): return None - return VALLOX_CELL_STATE_TO_STR.get(int(super_native_value)) + return VALLOX_CELL_STATE_TO_STR.get(super_native_value) @dataclass