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 for get_presets #15

Merged
merged 2 commits into from
Sep 15, 2019
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
9 changes: 6 additions & 3 deletions haanna/haanna.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,14 @@ def get_presets(self, root):
if self.is_legacy_anna(root):
return self.__get_preset_dictionary_v1(root)
else:
rule_id = self.get_rule_id_by_name(root,
'Thermostat presets')
rule_id = self.get_rule_id_by_template_tag(root,
'zone_setpoint_and_state_based_on_preset')[0]

if rule_id is None:
raise RuleIdNotFoundException("Could not find the rule id.")
rule_id = self.get_rule_id_by_name(root,
'Thermostat presets')
if rule_id is None:
raise RuleIdNotFoundException("Could not find the rule id.")

presets = self.get_preset_dictionary(root, rule_id)
return presets
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def readme():

setup(
name='haanna',
version='0.10.1',
version='0.10.2',
description='Plugwise Anna API to use in conjunction with Home Assistant.',
long_description='Plugwise Anna API to use in conjunction with Home Assistant, but it can also be used without Home Assistant.',
keywords='HomeAssistant HA Home Assistant Anna Plugwise',
Expand Down