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

Add new functions to start firmware updates #317

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FaserF
Copy link

@FaserF FaserF commented Sep 6, 2024

This PR is to extend the functionality for Homeassistant to detect available tasmota firmware updates and start them remotly. See #151 and

The HA Integration also needed to be extended, this work is being done here for a future PR to the core repo:
https://github.com/FaserF/core/tree/new-feat-tasmota-firmware-update

Please note, that I am writing my own HA integrations, but never did a firmware update check and update sensor before. I would be happy about someone reviewing my code. I was also until now not fully able to test the code, since I always had used custom_components and dont know how to test updated official integrations until now.
Right now the code seems to fail:

2024-09-06 15:55:15.321 ERROR (MainThread) [homeassistant.components.update] Error while setting up tasmota_fw_test platform for update
AttributeError: module 'custom_components.tasmota_fw_test.update' has no attribute 'async_setup_entry'
2024-09-06 15:55:15.323 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Tasmota for tasmota_fw_test
File "/config/custom_components/tasmota_fw_test/__init__.py", line 86, in async_setup_entry

To test the functionality I have created a new repository: https://github.com/FaserF/ha-tasmota-fwupdate
The new pip module needs to be installed manually:

pip3 install git+https://github.com/FaserF/hatasmota.git@new-feat-firmware-update

More informations about what the final goal should be:
https://community.home-assistant.io/t/support-firmware-update-in-tasmota-integration/410167
arendst/Tasmota#15480

Copy link
Owner

@emontnemery emontnemery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good @FaserF 👍

You're most welcome to contact me on discord, my username there is @emontnemery, if you to discuss how to make this happen in the tasmota integration.

@@ -3,9 +3,10 @@
from __future__ import annotations

import asyncio
import logging
import requests
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hatasmota library is mostly written with asyncio instead of threads for parallelism. Could you try to use aiohttp instead of requests for the firmware check?

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

Successfully merging this pull request may close these issues.

2 participants