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

Climate component - hardcoded IP address in async_set_hvac_mode? #3

Open
lawtancool opened this issue Dec 8, 2019 · 0 comments
Open

Comments

@lawtancool
Copy link

@asyncio.coroutine
def async_set_hvac_mode(self, hvac_mode):
url_str = 'http://192.168.86.152:8080/'
if self._proxy_id == 36:
url_str = url_str + 'ThreeMode'
else:
url_str = url_str + 'TwoMode'
if hvac_mode == HVAC_MODE_HEAT:
self._current_operation = HVAC_MODE_HEAT
self._enabled = True
url_str = url_str + 'Heat'
elif hvac_mode == HVAC_MODE_COOL:
self._current_operation = HVAC_MODE_COOL
self._enabled = True
url_str = url_str + 'Cool'
elif hvac_mode == HVAC_MODE_AUTO:
self._current_operation = HVAC_MODE_AUTO
self._enabled = True
url_str = url_str + 'Auto'
elif hvac_mode == HVAC_MODE_OFF:
self._current_operation = HVAC_MODE_OFF
self._enabled = False
url_str = url_str + 'Off'
websession = async_get_clientsession(self.hass)
request = None
with async_timeout.timeout(TIMEOUT, loop=self.hass.loop):
request = yield from websession.get(url_str)
return

I was just wondering, what is this code supposed to do? Since there's a hardcoded IP address, how would a user use this component to change the HVAC mode on their Control4 system on a different IP?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant