Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix circ reference, import from pychonet #192 #193

Merged
merged 3 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions custom_components/echonetlite/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
from pychonet.CeilingFan import (
ENL_FANSPEED_PERCENT,
ENL_FAN_DIRECTION,
ENL_FAN_OSCILLATION,
ENL_FANSPEED_PERCENT,
)

DOMAIN = "echonetlite"
Expand Down
15 changes: 9 additions & 6 deletions custom_components/echonetlite/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

following the import ref on this one, its coming from pychonet.HomeAirConditioner https://github.com/scottyphillips/echonetlite_homeassistant/blob/8fb38203bcdd010b5fca5dc99ac5c7337323b258/custom_components/echonetlite/const.py#L34C5-L34C17 which I'm guessing while it works and the value is the same its not 100% correct

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"]
Expand Down
Loading