Skip to main content

Python package that dialogs with Rika pellet stove (under dev)

Project description

Rika Firenet

https://img.shields.io/pypi/v/rikafirenet.svg

Python package that dialogs with Rika pellet stove

  • Free software: MIT license

Usage

"""Exemple of how to communicate with stove"""
import sys
from pathlib import Path
import asyncio
import os
import yaml
import aiohttp
from rikafirenet import Stove, OperatingMode

async def get_yaml_info(file):
    """Asynchronously load YAML file"""
    try:
        with open(file, encoding="utf-8") as stream:
            return yaml.safe_load(stream)
    except yaml.YAMLError as exc:
        return exc

async def main():
    """main program"""
    # Set up the session
    async with aiohttp.ClientSession() as session:
        # Load secrets
        secret_file = Path(os.path.dirname(__file__) + "/secret.yaml")
        secret = await get_yaml_info(secret_file)
        username = secret['username']
        password = secret['password']
        stove_id = secret['stove_id']
        # Create Stove instance
        stove = Stove(session, username, password, stove_id)

        # Connect to stove
        if not await stove.connect():
            sys.exit(1)

        print("")
        print('Synching state', await stove.sync_state())
        print('Target temperature', await stove.get_stove_thermostat(), '°C')
        print('Consumption', await stove.get_stove_consumption(), 'Kg')
        print('Consumption before service', await stove.get_consumption_before_service(), 'Kg')
        print('Runtime', await stove.get_stove_runtime(), 'hours')
        print('Room temperature', await stove.get_room_temperature(), '°C')
        print('Burning', await stove.is_stove_burning())
        print('Flame temperature', await stove.get_stove_flame_temperature(), '°C')
        print('Get Operating mode', await stove.get_stove_operating_mode())
        print('Is on?', await stove.is_stove_on())
        print(
            'Is heating times active for comfort',
            await stove.is_heating_times_active_for_comfort()
        )
        print('State', await stove.get_state())
        print('WiFi signal', await stove.get_wifi_signal())
        print('')
        # Uncomment the following to control the stove
        print("Turning on", await stove.turn_on())
        print("Turning off", await stove.turn_off())
        # print(await stove.set_stove_operating_mode(OperatingMode.MANUAL.value))
        print('Operating mode', OperatingMode.MANUAL.value)
        # print('Set temperature', 20, await stove.set_stove_thermostat(20))
        print('Set manual power', 30, await stove.set_manual_power(30))
        print('Set comfort power', 3, await stove.set_confort_power(3))
        await stove.send_controls()

# Run the async main function
if __name__ == "__main__":
    asyncio.run(main())

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.0 (2024-11-30)

  • fixed compatibility with python 3.12

0.0.7 (2024-11-29)

  • Use async function

  • fixed depedencies

0.0.5 (2022-11-28)

  • Added fan 1 & 2

  • Added back temperature

0.0.4 (2022-11-27)

  • Cleaned code with pylint.

0.0.3 (2022-11-22)

  • Added more states and actions.

0.0.1 (2022-11-17)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rikafirenet-0.1.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rikafirenet-0.1.0-py2.py3-none-any.whl (9.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file rikafirenet-0.1.0.tar.gz.

File metadata

  • Download URL: rikafirenet-0.1.0.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for rikafirenet-0.1.0.tar.gz
Algorithm Hash digest
SHA256 06bc101b56291fede353a8b741fc70827b81b8e085ab55e02a140a240b30b915
MD5 3a6345d43424b512f81471d7c87d046a
BLAKE2b-256 4dde20262ba764b45f6d1fd991d35749b89b0125793db76f0096e7ac388652be

See more details on using hashes here.

File details

Details for the file rikafirenet-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: rikafirenet-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for rikafirenet-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f5d19507bb59ca79c091e703d6226f3259cee30ad96feeb75a454d94293430d5
MD5 768d575a37decebc41774ee14b02023f
BLAKE2b-256 a6eb5487002f917382878a38ef0c7f1199275d40505f99833f4aee6969c331e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page