Skip to content

Commit

Permalink
proper logger. 2.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yozik04 committed May 29, 2020
1 parent 1cb82a4 commit 2c60dde
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def read(filename, parent=None):
setup(
name="vallox_websocket_api",
packages=["vallox_websocket_api"],
version="2.5.0",
version="2.6.0",
python_requires=">=3.5.1, <4",
description="Vallox WebSocket API",
author="Jevgeni Kiski",
Expand Down
16 changes: 9 additions & 7 deletions vallox_websocket_api/vallox.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import logging
from enum import Enum
from enum import IntEnum

from .client import Client

logger = logging.getLogger('vallox').getChild(__name__)

class PROFILE(Enum):

class PROFILE(IntEnum):
NONE = 0
HOME = 1
AWAY = 2
Expand Down Expand Up @@ -112,7 +114,7 @@ async def set_profile(self, profile, duration=None):
# duration: None means default configured setting. 65535 means no time out

if profile == PROFILE.HOME:
logging.info("Setting unit to HOME profile")
logger.info("Setting unit to HOME profile")
await self.set_values(
{
"A_CYC_STATE": "0",
Expand All @@ -122,7 +124,7 @@ async def set_profile(self, profile, duration=None):
}
)
elif profile == PROFILE.AWAY:
logging.info("Setting unit to AWAY profile")
logger.info("Setting unit to AWAY profile")
await self.set_values(
{
"A_CYC_STATE": "1",
Expand All @@ -136,7 +138,7 @@ async def set_profile(self, profile, duration=None):
dur = str(set_duration)
else:
dur = str(await self.fetch_metric("A_CYC_FIREPLACE_TIME"))
logging.info("Setting unit to FIREPLACE profile for %s minutes", dur)
logger.info("Setting unit to FIREPLACE profile for %s minutes", dur)
await self.set_values(
{
"A_CYC_BOOST_TIMER": "0",
Expand All @@ -149,7 +151,7 @@ async def set_profile(self, profile, duration=None):
dur = str(set_duration)
else:
dur = str(await self.fetch_metric("A_CYC_BOOST_TIME"))
logging.info("Setting unit to BOOST profile for %s minutes", dur)
logger.info("Setting unit to BOOST profile for %s minutes", dur)
await self.set_values(
{
"A_CYC_BOOST_TIMER": dur,
Expand All @@ -162,7 +164,7 @@ async def set_profile(self, profile, duration=None):
dur = str(set_duration)
else:
dur = str(await self.fetch_metric("A_CYC_EXTRA_TIME"))
logging.info("Setting unit to EXTRA profile for %s minutes", dur)
logger.info("Setting unit to EXTRA profile for %s minutes", dur)
await self.set_values(
{
"A_CYC_BOOST_TIMER": "0",
Expand Down

0 comments on commit 2c60dde

Please sign in to comment.