A Python API made for use in conjunction with the Home Assistant Anna component, but this API can also be used in other projects.
pip install haanna
from haanna import haanna
# Create the API
api = haanna.Haanna('smile', 'short_id', '192.168.1.60')
# Fetch the domain objects
domain_objects = api.get_domain_objects()
# Set the temperature
temperature = api.set_temperature(domain_objects, 22.50)
print(temperature)
# Get the temperature
temperature = api.get_temperature(domain_objects)
print(temperature)
# Get the outdoor temperature
temperature = api.get_outdoor_temperature(domain_objects)
print(temperature)
# Get the target temperature
temperature = api.get_target_temperature(domain_objects)
print(temperature)
# Get the available presets
presets = api.get_presets(domain_objects)
print(presets)
# Get the current active preset
current_preset = api.get_current_preset(domain_objects)
print(current_preset)
# Set a preset
preset = api.set_preset(domain_objects, 'away')
print(preset)
- Optimize fetching of domain objects
- Add support for custom port mapping