From 6b253d82f9fb2c276f261f96ec06de3b5735f5bc Mon Sep 17 00:00:00 2001 From: Josh Shaw Date: Sun, 15 Sep 2024 19:03:59 +1200 Subject: [PATCH 1/3] Fix circ reference, import from pychonet #192 --- custom_components/echonetlite/const.py | 7 +++---- custom_components/echonetlite/fan.py | 15 +++++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/custom_components/echonetlite/const.py b/custom_components/echonetlite/const.py index 209d02b..d997971 100644 --- a/custom_components/echonetlite/const.py +++ b/custom_components/echonetlite/const.py @@ -47,11 +47,10 @@ from pychonet.EchonetInstance import ENL_STATUS, ENL_ON, ENL_OFF from pychonet.lib.const import ENL_CUMULATIVE_POWER, ENL_INSTANTANEOUS_POWER from pychonet.lib.epc_functions import DATA_STATE_CLOSE, DATA_STATE_OPEN - -from custom_components.echonetlite.fan import ( - ENL_FAN_DIRECTION, - ENL_FAN_OSCILLATION, +from pychonet.CeilingFan import ( ENL_FANSPEED_PERCENT, + ENL_FAN_DIRECTION, + ENL_FAN_OSCILLATION ) DOMAIN = "echonetlite" diff --git a/custom_components/echonetlite/fan.py b/custom_components/echonetlite/fan.py index 17e14a7..65a8f2d 100644 --- a/custom_components/echonetlite/fan.py +++ b/custom_components/echonetlite/fan.py @@ -8,15 +8,18 @@ PRECISION_WHOLE, ) from . import get_device_name -from .const import CONF_FORCE_POLLING, DATA_STATE_ON, DOMAIN +from .const import ( + CONF_FORCE_POLLING, + DATA_STATE_ON, + DOMAIN, + ENL_FANSPEED, + ENL_FANSPEED_PERCENT, + ENL_FAN_DIRECTION, + ENL_FAN_OSCILLATION +) _LOGGER = logging.getLogger(__name__) -ENL_FANSPEED = 0xA0 -ENL_FANSPEED_PERCENT = 0xF0 -ENL_FAN_DIRECTION = 0xF1 -ENL_FAN_OSCILLATION = 0xF2 - DEFAULT_FAN_MODES = list( FAN_SPEED.keys() ) # ["auto","minimum","low","medium-low","medium","medium-high","high","very-high","max"] From 00f72b8f6dbac36435241aad6dbe0fc515bbe9cc Mon Sep 17 00:00:00 2001 From: Naoki Sawada Date: Sun, 15 Sep 2024 16:58:13 +0900 Subject: [PATCH 2/3] Lint fix --- custom_components/echonetlite/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/echonetlite/const.py b/custom_components/echonetlite/const.py index d997971..41de37c 100644 --- a/custom_components/echonetlite/const.py +++ b/custom_components/echonetlite/const.py @@ -50,7 +50,7 @@ from pychonet.CeilingFan import ( ENL_FANSPEED_PERCENT, ENL_FAN_DIRECTION, - ENL_FAN_OSCILLATION + ENL_FAN_OSCILLATION, ) DOMAIN = "echonetlite" From c43479c22c40593edd2fcdcac80f94ca7ecb069f Mon Sep 17 00:00:00 2001 From: Naoki Sawada Date: Sun, 15 Sep 2024 17:00:19 +0900 Subject: [PATCH 3/3] Lint fix --- custom_components/echonetlite/fan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/echonetlite/fan.py b/custom_components/echonetlite/fan.py index 65a8f2d..0c99ddb 100644 --- a/custom_components/echonetlite/fan.py +++ b/custom_components/echonetlite/fan.py @@ -15,7 +15,7 @@ ENL_FANSPEED, ENL_FANSPEED_PERCENT, ENL_FAN_DIRECTION, - ENL_FAN_OSCILLATION + ENL_FAN_OSCILLATION, ) _LOGGER = logging.getLogger(__name__)