Closed
Description
I think it's a good idea to make a list of features and improvements we can make in the future. I'll start with my list:
- Extract code and create base class for entities, e.g.
LocalTuyaEntity
based on a config entry. - Update entity on-the-fly when options are changed without having to restart Home Assistant (depends first bullet and Add support for config flow option #14).
- Scanning support in config flow.
- Use scanning to find a device before connecting to it, to handle dynamic IP address changes. I use a similar scheme in the Apple TV component.
- Break out status polling from individual entities and inform entities about updates via the signal interface. This allows us to update devices with multiple entities, e.g. double gang switches, with one request instead of one per entity.
- Make our pytuya implementation actually support the protocol, e.g. by inserting correct sequence number (and other stuff that needs to be handled). The outcome I'm after is to have the network connection up at all time instead of connecting, sending command and immediately disconnect when done. I believe this will be a lot more stable and faster.
- Convert pytuya to asyncio (and the rest of the integration as well).
- Add generic
sensor
andbinary_sensor
platforms that can read any DPS value and present as state. - Easy set up of helper sensor, e.g.
integration
sensor that calculateskWh
for used energy. - General code clean up, removing commented code (it's still available via git history), remove print statements and change some to debug, run
black
,pylint
andflake8
on all code. - Improve documentation, translations in config flows, etc.
Anything I have missed? After some discussion we could make a priority list, create issues for things to do and come up with a roadmap (as supported here on GitHub).