Skip to content

Commit

Permalink
Fix for reading default value for poll parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Seba committed Apr 23, 2019
1 parent 5f705f0 commit 2e02aef
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
vol.Optional(CONF_TEMPERATURE_UNIT, default=DEFAULT_CONF_TEMP_UNIT): cv.string,
vol.Optional(CONF_CONTROLLER, default=DEFAULT_CONF_CONTROLLER): cv.string,
vol.Optional(CONF_DEBUG, default=False): cv.boolean,
vol.Optional(CONFIG_DEVICE_POLL, default=None): cv.boolean,
vol.Optional(CONFIG_DEVICE_POLL, default=""): cv.string,
vol.Optional(CONFIG_DEVICE_UPDATE_DELAY, default=DEFAULT_UPDATE_DELAY): cv.string,
})

Expand Down Expand Up @@ -145,7 +145,14 @@ def __init__(self, rac_controller, config):
self.rac = rac_controller
self._name = config.get(CONFIG_DEVICE_NAME, None)
self._friendly_name = config.get(CONFIG_DEVICE_FRIENDLY_NAME, None)
self._poll = config.get(CONFIG_DEVICE_POLL, None)
self._poll = None
str_poll = config.get(CONFIG_DEVICE_POLL, "")
if str_poll:
str_poll = str_poll.lower()
if str_poll == "false":
self._poll = False
elif str_poll == "true":
self._poll = True
features = 0
for f in SUPPORTED_FEATURES_MAP.keys():
if f in self.rac.operations:
Expand Down

0 comments on commit 2e02aef

Please sign in to comment.