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

Emergency Heat #23

Open
apetrycki opened this issue Dec 1, 2018 · 0 comments
Open

Emergency Heat #23

apetrycki opened this issue Dec 1, 2018 · 0 comments

Comments

@apetrycki
Copy link

I'm guessing the Emergency Heat changed from when it was first implemented. I hacked around the issue by doing:

    def system_mode(self, mode):
        try:
            mode_index = SYSTEM_MODES.index(mode)
        except ValueError:
            raise SomeComfortError('Invalid system mode `%s`' % mode)
        if mode == 'emheat':
            key = 'SwitchEmergencyHeatAllowed'
        else:
            key = 'Switch%sAllowed' % mode.title()
        try:
            if not self._data['uiData'][key]:
                raise SomeComfortError('Device does not support %s' % mode)
        except KeyError:
            raise APIError(
                'Unknown Key: %s' % key)
        self._client._set_thermostat_settings(
            self.deviceid, {'SystemSwitch': mode_index})
        self._data['uiData']['SystemSwitchPosition'] = mode_index

in client.py

It isn't pretty, but it maintains backwards compatibility.

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