mirror of
https://github.com/micahqcade/custom_vesync.git
synced 2025-02-11 09:39:00 +01:00
Merge pull request #3 from AndreaTomatis/new_SUPPORT_MODES
Fixed deprecation
This commit is contained in:
commit
2757cb3b02
@ -1,6 +1,9 @@
|
|||||||
"""VeSync integration."""
|
"""VeSync integration."""
|
||||||
import logging
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
import logging
|
||||||
|
|
||||||
|
from pyvesync.vesync import VeSync
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, Platform
|
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, Platform
|
||||||
@ -8,7 +11,6 @@ from homeassistant.core import HomeAssistant, ServiceCall
|
|||||||
from homeassistant.helpers import config_validation as cv
|
from homeassistant.helpers import config_validation as cv
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
||||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
||||||
from pyvesync.vesync import VeSync
|
|
||||||
|
|
||||||
from .common import async_process_devices
|
from .common import async_process_devices
|
||||||
from .const import (
|
from .const import (
|
||||||
@ -68,7 +70,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
|
|||||||
try:
|
try:
|
||||||
await hass.async_add_executor_job(manager.update)
|
await hass.async_add_executor_job(manager.update)
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
raise UpdateFailed(f"Update failed: {err}")
|
raise UpdateFailed(f"Update failed: {err}") from err
|
||||||
|
|
||||||
coordinator = DataUpdateCoordinator(
|
coordinator = DataUpdateCoordinator(
|
||||||
hass,
|
hass,
|
||||||
@ -111,7 +113,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
|
|||||||
else:
|
else:
|
||||||
hass.async_create_task(forward_setup(config_entry, platform))
|
hass.async_create_task(forward_setup(config_entry, platform))
|
||||||
|
|
||||||
for k, v in PLATFORMS.items():
|
for k in PLATFORMS:
|
||||||
_add_new_devices(k)
|
_add_new_devices(k)
|
||||||
|
|
||||||
hass.services.async_register(
|
hass.services.async_register(
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Support for power & energy sensors for VeSync outlets."""
|
"""Support for power & energy sensors for VeSync outlets."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import BinarySensorEntity
|
from homeassistant.components.binary_sensor import BinarySensorEntity
|
||||||
@ -46,7 +47,7 @@ def _setup_entities(devices, async_add_entities, coordinator):
|
|||||||
for dev in devices:
|
for dev in devices:
|
||||||
if hasattr(dev, "fryer_status"):
|
if hasattr(dev, "fryer_status"):
|
||||||
for stype in BINARY_SENSOR_TYPES_AIRFRYER.values():
|
for stype in BINARY_SENSOR_TYPES_AIRFRYER.values():
|
||||||
entities.append(
|
entities.append( # noqa: PERF401
|
||||||
VeSyncairfryerSensor(
|
VeSyncairfryerSensor(
|
||||||
dev,
|
dev,
|
||||||
coordinator,
|
coordinator,
|
||||||
@ -88,8 +89,7 @@ class VeSyncairfryerSensor(VeSyncBaseEntity, BinarySensorEntity):
|
|||||||
@property
|
@property
|
||||||
def is_on(self) -> bool:
|
def is_on(self) -> bool:
|
||||||
"""Return a value indicating whether the Humidifier's water tank is lifted."""
|
"""Return a value indicating whether the Humidifier's water tank is lifted."""
|
||||||
value = getattr(self.airfryer, self.stype[0], None)
|
return getattr(self.airfryer, self.stype[0], None)
|
||||||
return value
|
|
||||||
# return self.smarthumidifier.details["water_tank_lifted"]
|
# return self.smarthumidifier.details["water_tank_lifted"]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Support for VeSync button."""
|
"""Support for VeSync button."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.button import ButtonEntity
|
from homeassistant.components.button import ButtonEntity
|
||||||
@ -55,7 +56,7 @@ def _setup_entities(devices, async_add_entities, coordinator):
|
|||||||
for dev in devices:
|
for dev in devices:
|
||||||
if hasattr(dev, "cook_set_temp"):
|
if hasattr(dev, "cook_set_temp"):
|
||||||
for stype in SENSOR_TYPES_CS158.values():
|
for stype in SENSOR_TYPES_CS158.values():
|
||||||
entities.append(
|
entities.append( # noqa: PERF401
|
||||||
VeSyncairfryerButton(
|
VeSyncairfryerButton(
|
||||||
dev,
|
dev,
|
||||||
coordinator,
|
coordinator,
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
"""Common utilities for VeSync Component."""
|
"""Common utilities for VeSync Component."""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from pyvesync.vesyncfan import model_features as fan_model_features
|
||||||
|
from pyvesync.vesynckitchen import model_features as kitchen_model_features
|
||||||
|
|
||||||
from homeassistant.components.diagnostics import async_redact_data
|
from homeassistant.components.diagnostics import async_redact_data
|
||||||
from homeassistant.helpers.entity import Entity, ToggleEntity
|
from homeassistant.helpers.entity import Entity, ToggleEntity
|
||||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||||
from pyvesync.vesyncfan import model_features as fan_model_features
|
|
||||||
from pyvesync.vesynckitchen import model_features as kitchen_model_features
|
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
@ -104,7 +105,7 @@ async def async_process_devices(hass, manager):
|
|||||||
in VS_AIRFRYER_TYPES
|
in VS_AIRFRYER_TYPES
|
||||||
):
|
):
|
||||||
_LOGGER.warning(
|
_LOGGER.warning(
|
||||||
"Found air fryer %s, support in progress.\n%s", airfryer.device_name
|
"Found air fryer %s, support in progress.\n", airfryer.device_name
|
||||||
)
|
)
|
||||||
devices[VS_SENSORS].append(airfryer)
|
devices[VS_SENSORS].append(airfryer)
|
||||||
devices[VS_BINARY_SENSORS].append(airfryer)
|
devices[VS_BINARY_SENSORS].append(airfryer)
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
"""Config flow utilities."""
|
"""Config flow utilities."""
|
||||||
import logging
|
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
import logging
|
||||||
|
|
||||||
|
from pyvesync.vesync import VeSync
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
from homeassistant.components import dhcp
|
from homeassistant.components import dhcp
|
||||||
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
from homeassistant.data_entry_flow import FlowResult
|
from homeassistant.data_entry_flow import FlowResult
|
||||||
from pyvesync.vesync import VeSync
|
|
||||||
|
|
||||||
from .const import DOMAIN
|
from .const import DOMAIN
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Constants for VeSync Component."""
|
"""Constants for VeSync Component."""
|
||||||
|
|
||||||
from homeassistant.const import DEVICE_CLASS_TEMPERATURE, TEMP_CELSIUS, TIME_MINUTES
|
from homeassistant.components.sensor import SensorDeviceClass
|
||||||
|
from homeassistant.const import UnitOfTemperature, UnitOfTime
|
||||||
|
|
||||||
DOMAIN = "vesync"
|
DOMAIN = "vesync"
|
||||||
VS_DISCOVERY = "vesync_discovery_{}"
|
VS_DISCOVERY = "vesync_discovery_{}"
|
||||||
@ -72,33 +73,33 @@ SENSOR_TYPES_AIRFRYER = {
|
|||||||
"current_temp": [
|
"current_temp": [
|
||||||
"current_temperature",
|
"current_temperature",
|
||||||
"Current temperature",
|
"Current temperature",
|
||||||
TEMP_CELSIUS,
|
UnitOfTemperature.CELSIUS,
|
||||||
None,
|
None,
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
SensorDeviceClass.TEMPERATURE,
|
||||||
"current_temp",
|
"current_temp",
|
||||||
],
|
],
|
||||||
"cook_set_temp": [
|
"cook_set_temp": [
|
||||||
"set_temperature",
|
"set_temperature",
|
||||||
"Set temperature",
|
"Set temperature",
|
||||||
TEMP_CELSIUS,
|
UnitOfTemperature.CELSIUS,
|
||||||
None,
|
None,
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
SensorDeviceClass.TEMPERATURE,
|
||||||
"cook_set_temp",
|
"cook_set_temp",
|
||||||
],
|
],
|
||||||
"cook_last_time": [
|
"cook_last_time": [
|
||||||
"cook_last_time",
|
"cook_last_time",
|
||||||
"Cook Remaining",
|
"Cook Remaining",
|
||||||
TIME_MINUTES,
|
UnitOfTime.MINUTES,
|
||||||
"mdi:timer",
|
"mdi:timer",
|
||||||
TIME_MINUTES,
|
UnitOfTime.MINUTES,
|
||||||
"cook_last_time",
|
"cook_last_time",
|
||||||
],
|
],
|
||||||
"preheat_last_time": [
|
"preheat_last_time": [
|
||||||
"preheat_last_time",
|
"preheat_last_time",
|
||||||
"Preheat Remaining",
|
"Preheat Remaining",
|
||||||
TIME_MINUTES,
|
UnitOfTime.MINUTES,
|
||||||
"mdi:timer",
|
"mdi:timer",
|
||||||
TIME_MINUTES,
|
UnitOfTime.MINUTES,
|
||||||
"preheat_last_time",
|
"preheat_last_time",
|
||||||
],
|
],
|
||||||
"cook_status": [
|
"cook_status": [
|
||||||
@ -112,9 +113,9 @@ SENSOR_TYPES_AIRFRYER = {
|
|||||||
# "remaining_time": [
|
# "remaining_time": [
|
||||||
# "remaining_time",
|
# "remaining_time",
|
||||||
# "running:",
|
# "running:",
|
||||||
# TIME_MINUTES,
|
# UnitOfTime.MINUTES,
|
||||||
# "mdi:timer",
|
# "mdi:timer",
|
||||||
# TIME_MINUTES,
|
# UnitOfTime.MINUTES,
|
||||||
# "remaining_time",
|
# "remaining_time",
|
||||||
# ],
|
# ],
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import homeassistant.helpers.config_validation as cv
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.device_automation import toggle_entity
|
from homeassistant.components.device_automation import toggle_entity
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_ENTITY_ID,
|
ATTR_ENTITY_ID,
|
||||||
@ -16,7 +16,8 @@ from homeassistant.const import (
|
|||||||
)
|
)
|
||||||
from homeassistant.core import Context, HomeAssistant
|
from homeassistant.core import Context, HomeAssistant
|
||||||
from homeassistant.exceptions import HomeAssistantError
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
from homeassistant.helpers import entity_registry
|
from homeassistant.helpers import entity_registry as er
|
||||||
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.entity import get_capability
|
from homeassistant.helpers.entity import get_capability
|
||||||
from homeassistant.helpers.typing import ConfigType, TemplateVarsType
|
from homeassistant.helpers.typing import ConfigType, TemplateVarsType
|
||||||
|
|
||||||
@ -41,11 +42,11 @@ async def async_get_actions(
|
|||||||
hass: HomeAssistant, device_id: str
|
hass: HomeAssistant, device_id: str
|
||||||
) -> list[dict[str, str]]:
|
) -> list[dict[str, str]]:
|
||||||
"""List device actions for Humidifier devices."""
|
"""List device actions for Humidifier devices."""
|
||||||
registry = entity_registry.async_get(hass)
|
registry = er.async_get(hass)
|
||||||
actions = await toggle_entity.async_get_actions(hass, device_id, DOMAIN)
|
actions = await toggle_entity.async_get_actions(hass, device_id, DOMAIN)
|
||||||
|
|
||||||
# Get all the integrations entities for this device
|
# Get all the integrations entities for this device
|
||||||
for entry in entity_registry.async_entries_for_device(registry, device_id):
|
for entry in er.async_entries_for_device(registry, device_id):
|
||||||
if entry.domain != "fan":
|
if entry.domain != "fan":
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Support for VeSync fans."""
|
"""Support for VeSync fans."""
|
||||||
|
|
||||||
import math
|
import math
|
||||||
|
|
||||||
from homeassistant.components.fan import FanEntity, FanEntityFeature
|
from homeassistant.components.fan import FanEntity, FanEntityFeature
|
||||||
@ -165,9 +166,9 @@ class VeSyncFanHA(VeSyncDevice, FanEntity):
|
|||||||
|
|
||||||
def turn_on(
|
def turn_on(
|
||||||
self,
|
self,
|
||||||
speed: str = None,
|
# speed: str | None = None,
|
||||||
percentage: int = None,
|
percentage: int | None = None,
|
||||||
preset_mode: str = None,
|
preset_mode: str | None = None,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Turn the device on."""
|
"""Turn the device on."""
|
||||||
|
@ -1,21 +1,23 @@
|
|||||||
"""Support for VeSync humidifiers."""
|
"""Support for VeSync humidifiers."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Mapping
|
from typing import Any
|
||||||
|
|
||||||
|
from pyvesync.vesyncfan import VeSyncHumid200300S
|
||||||
|
|
||||||
from homeassistant.components.humidifier import HumidifierEntity
|
from homeassistant.components.humidifier import HumidifierEntity
|
||||||
from homeassistant.components.humidifier.const import (
|
from homeassistant.components.humidifier.const import (
|
||||||
MODE_AUTO,
|
MODE_AUTO,
|
||||||
MODE_NORMAL,
|
MODE_NORMAL,
|
||||||
MODE_SLEEP,
|
MODE_SLEEP,
|
||||||
SUPPORT_MODES,
|
HumidifierEntityFeature,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from pyvesync.vesyncfan import VeSyncHumid200300S
|
|
||||||
|
|
||||||
from .common import VeSyncDevice
|
from .common import VeSyncDevice
|
||||||
from .const import (
|
from .const import (
|
||||||
@ -122,7 +124,7 @@ class VeSyncHumidifierHA(VeSyncDevice, HumidifierEntity):
|
|||||||
@property
|
@property
|
||||||
def supported_features(self):
|
def supported_features(self):
|
||||||
"""Flag supported features."""
|
"""Flag supported features."""
|
||||||
return SUPPORT_MODES
|
return HumidifierEntityFeature.MODES
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def target_humidity(self) -> int:
|
def target_humidity(self) -> int:
|
||||||
|
@ -1,7 +1,13 @@
|
|||||||
{
|
{
|
||||||
"domain": "vesync",
|
"domain": "vesync",
|
||||||
"name": "VeSync",
|
"name": "VeSync",
|
||||||
"codeowners": ["@markperdue", "@webdjoe", "@thegardenmonkey", "@vlebourl","@tv4you2016"],
|
"codeowners": [
|
||||||
|
"@markperdue",
|
||||||
|
"@webdjoe",
|
||||||
|
"@thegardenmonkey",
|
||||||
|
"@vlebourl",
|
||||||
|
"@tv4you2016"
|
||||||
|
],
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"dhcp": [
|
"dhcp": [
|
||||||
{
|
{
|
||||||
@ -9,9 +15,11 @@
|
|||||||
"macaddress": "*"
|
"macaddress": "*"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"documentation": "https://www.home-assistant.io/integrations/vesync",
|
"documentation": "https://github.com/AndreaTomatis/custom_vesync",
|
||||||
"iot_class": "cloud_polling",
|
"iot_class": "cloud_polling",
|
||||||
"issue_tracker": "https://github.com/vlebourl/custom_vesync",
|
"issue_tracker": "https://github.com/AndreaTomatis/custom_vesync",
|
||||||
"requirements": ["pyvesync==2.1.10"],
|
"requirements": [
|
||||||
"version": "1.3.0"
|
"pyvesync==2.1.10"
|
||||||
}
|
],
|
||||||
|
"version": "1.3.1"
|
||||||
|
}
|
@ -208,8 +208,7 @@ class VeSyncHumidifierTargetLevelHA(VeSyncNumberEntity):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self):
|
def device_class(self):
|
||||||
"""
|
"""Return the device class of the target humidity level.
|
||||||
Return the device class of the target humidity level.
|
|
||||||
|
|
||||||
Eventually this should become NumberDeviceClass but that was introduced in 2022.12.
|
Eventually this should become NumberDeviceClass but that was introduced in 2022.12.
|
||||||
For maximum compatibility, using SensorDeviceClass as recommended by deprecation notice.
|
For maximum compatibility, using SensorDeviceClass as recommended by deprecation notice.
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
"""Support for power & energy sensors for VeSync outlets."""
|
"""Support for power & energy sensors for VeSync outlets."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.sensor import (
|
from homeassistant.components.sensor import (
|
||||||
@ -7,7 +8,7 @@ from homeassistant.components.sensor import (
|
|||||||
SensorStateClass,
|
SensorStateClass,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import ENERGY_KILO_WATT_HOUR, PERCENTAGE, POWER_WATT
|
from homeassistant.const import PERCENTAGE, UnitOfEnergy, UnitOfPower
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
from homeassistant.helpers.entity import EntityCategory
|
from homeassistant.helpers.entity import EntityCategory
|
||||||
@ -57,7 +58,7 @@ def _setup_entities(devices, async_add_entities, coordinator):
|
|||||||
for dev in devices:
|
for dev in devices:
|
||||||
if hasattr(dev, "fryer_status"):
|
if hasattr(dev, "fryer_status"):
|
||||||
for stype in SENSOR_TYPES_AIRFRYER.values():
|
for stype in SENSOR_TYPES_AIRFRYER.values():
|
||||||
entities.append(
|
entities.append( # noqa: PERF401
|
||||||
VeSyncairfryerSensor(
|
VeSyncairfryerSensor(
|
||||||
dev,
|
dev,
|
||||||
coordinator,
|
coordinator,
|
||||||
@ -111,8 +112,7 @@ class VeSyncairfryerSensor(VeSyncBaseEntity, SensorEntity):
|
|||||||
@property
|
@property
|
||||||
def native_value(self):
|
def native_value(self):
|
||||||
"""Return the value."""
|
"""Return the value."""
|
||||||
value = getattr(self.airfryer, self.stype[5], None)
|
return getattr(self.airfryer, self.stype[5], None)
|
||||||
return value
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def native_unit_of_measurement(self):
|
def native_unit_of_measurement(self):
|
||||||
@ -170,7 +170,7 @@ class VeSyncPowerSensor(VeSyncOutletSensorEntity):
|
|||||||
@property
|
@property
|
||||||
def native_unit_of_measurement(self):
|
def native_unit_of_measurement(self):
|
||||||
"""Return the Watt unit of measurement."""
|
"""Return the Watt unit of measurement."""
|
||||||
return POWER_WATT
|
return UnitOfPower.WATT
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state_class(self):
|
def state_class(self):
|
||||||
@ -214,7 +214,7 @@ class VeSyncEnergySensor(VeSyncOutletSensorEntity):
|
|||||||
@property
|
@property
|
||||||
def native_unit_of_measurement(self):
|
def native_unit_of_measurement(self):
|
||||||
"""Return the kWh unit of measurement."""
|
"""Return the kWh unit of measurement."""
|
||||||
return ENERGY_KILO_WATT_HOUR
|
return UnitOfEnergy.KILO_WATT_HOUR
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state_class(self):
|
def state_class(self):
|
||||||
@ -276,12 +276,12 @@ class VeSyncAirQualitySensor(VeSyncHumidifierSensorEntity):
|
|||||||
quality = self.smarthumidifier.details["air_quality"]
|
quality = self.smarthumidifier.details["air_quality"]
|
||||||
if isinstance(quality, (int, float)):
|
if isinstance(quality, (int, float)):
|
||||||
return quality
|
return quality
|
||||||
_LOGGER.warn(
|
_LOGGER.warning(
|
||||||
"Got non numeric value for AQI sensor from 'air_quality' for %s: %s",
|
"Got non numeric value for AQI sensor from 'air_quality' for %s: %s",
|
||||||
self.name,
|
self.name,
|
||||||
quality,
|
quality,
|
||||||
)
|
)
|
||||||
_LOGGER.warn("No air quality index found in '%s'", self.name)
|
_LOGGER.warning("No air quality index found in '%s'", self.name)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
@ -313,12 +313,12 @@ class VeSyncAirQualityValueSensor(VeSyncHumidifierSensorEntity):
|
|||||||
quality_value = self.smarthumidifier.details["air_quality_value"]
|
quality_value = self.smarthumidifier.details["air_quality_value"]
|
||||||
if isinstance(quality_value, (int, float)):
|
if isinstance(quality_value, (int, float)):
|
||||||
return quality_value
|
return quality_value
|
||||||
_LOGGER.warn(
|
_LOGGER.warning(
|
||||||
"Got non numeric value for AQI sensor from 'air_quality_value' for %s: %s",
|
"Got non numeric value for AQI sensor from 'air_quality_value' for %s: %s",
|
||||||
self.name,
|
self.name,
|
||||||
quality_value,
|
quality_value,
|
||||||
)
|
)
|
||||||
_LOGGER.warn("No air quality value found in '%s'", self.name)
|
_LOGGER.warning("No air quality value found in '%s'", self.name)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user