-
-
Save brunopk/b7a69f04c7ceb47518ae0698f691f66e to your computer and use it in GitHub Desktop.
- Use MyPy for type checking.
- Implement a function to load configurations and avoid duplicated code (see init method in src/controllers/hardware_controller.py and src/controllers/section_controller.py).
- Modify
helpcommand to return a description of each command (extracted from docstring). - Allow Home Assistant to set brightness when invoking
turn_section_oncommand (see https://chatgpt.com/c/692ce137-fc98-8331-9fe8-a511b0de6db0). - Consider implementing request/response pattern (MQTT 5).
- Improve errors by capturing and processing exceptions from mashumaro in order to return more descriptive errors, for instance, when some field is missing.
- Investigate how to exclude fields for serialization with mashumaro in order to avoid exposing
_configand other attributes inCommand. - Use device discovery mechanism to group entities into one device (more information in https://www.home-assistant.io/integrations/mqtt/#device-discovery-payload).
- Extract metrics using well-known tools.
- Send logs to Grafana Loki.
- Use uv instead of Poetry to avoid manteining commented out dependencies in here.
- Add the command to run Grafana Loki in docker.md or at least the usual port to expose it.
- Add an attribute in scrpi result (scrpi/result topic) to indicate the invoker (homeassistant or user).
- Create a
pingcommand to check the status of the system. It's returns "pong". Then this command can be used in a Home Assistant automation. - Create a
save_configcommand to save configuration into a YAML file. This may be particularly useful to store sections after doing changes with theedit_sectioncommand. - Send journal (systemd) logs to Grafana Loki.
- Send more descriptive messages in the
descriptionattribute ofScRpiError(result topic). - Provide a mechanism to use more than one configuration file, for example naming configuration files as
config.yaml,config_1.yaml,config_2.yamland so on. This will allow user to define diferent section configurations in different configuration files. - Modify
resetcommand to restart strip sections with a new configuration file (add a new parameter to indicate which configuration file to use). - Modify
get_configcommand to return different configuration files (add a new parameter to indicate which configuration file to return). Use YML for configurations instead of .ini files.Upgrade to Python > 3.8.Home Assistant documentation says messages for state topic are just "ON" or "OFF" (string), investigate if this payload works fine, and investigate the other state topics such asrgb_state_topic.
- Send broadcast messages from sc-master to detect available devices so users don't need to know IP addresses and ports.
- Multiple devices.
- Device and master (sc-master) metrics:
- Measure how much time takes to change color for all lights:
- Considering sc-web-sc-master-sc-rpi and/or sc-master-sc-rpi
- It should be 60 FPS ( no more than 1/60 seconds).
- CPU, memory, network, request/response times, etc.
- Investigate best approach:
- Implemented as sc-master RESTful endpoints (disadvantage: coupled to sc-master, advantage:maybe easier to implement).
- Separated from web server provided by DRF (advantage: decoupled from sc-master, see PCP).
- Displayed as graphics in sc-web or separated (see RabbitMQ)
- Measure how much time takes to change color for all lights:
- Deploy all with Docker. For example, sc-master and sc-web in the same container. It may be specially useful to dockerize it when implementing metrics in a decoupled way as mentioned above, the metric system may run in a different container.
- Different modes, specially useful when having multiple devices:
FUSIONED: all strips are viewed as one, so for example instead of controlling two strips each one with 300 leds, it can be viewed as one strip of size 600 working as one.SEPARATED: almost the opposite ofFUSIONED.
- Improve README.md for all components:
- Summarize and separate specific content in smaller markdown files.
- Provide a short description of what SC is (the same description for all components) in addition to current description of what the component is intended for and how to run it, no much more than this.
- Allow section editions which changes the order. For instance, having sections [4, 8] and [9, 10], allow editing the second section to [1, 2] (analyze if it could generate future issues before doing code changes).
- Provide a mechanism to synchronize sc-master with sc-rpi. For instance, if for sc-master leds are turned off and for sc-rpi they are turned on (for instance sc-master lost connection with sc-rpi just after turning leds off leading to the missmatch). This could be managed, with a periodic process to coordinates the state of both components, or just after sc-master try to invoke a specific command on sc-rpi.
-
Traduction file
-
Improve
font-sizedefinition to avoid issues with em and rem units (for example definefont-sizeinhtmltag and use onlyrem). -
Display sc-master server logs (generated by DRF) on the frontend. It may be better to include more attributes on sc-master command responses. For example when executing a
/turn_oncommand on sc-master, the output could be something like this :{ "code": "SC_RPI_ERROR", "device_name": "raspberry", "command": "turn_on" "status": 400 }where the
400indicates the status returned by raspberry after executing theturn_on(sc-rpi) command (think of trying to turn on more than one device, raspberry and raspberry2 by executing theturn_onfor both devices). -
Send raw commands (as stringified JSONs) directly to sc-rpi.
- Scan stores in all
src/pages/*instead of manually adding them as instance attributes inRootStoreclass.
-
Add back button on config flow to correct sections.
-
Support new types of color modes in homeassistant/components/strip_controller/light.py :
self._attr_supported_color_modes = {ColorMode.RGB, ColorMode.BRIGHTNESS}
Try to avoid this warning:
2024-06-17 21:21:39.256 WARNING (MainThread) [homeassistant.components.light] None (<class 'homeassistant.components.strip_controller.light.Section'>) sets invalid supported color modes {<ColorMode.BRIGHTNESS: 'brightness'>, <ColorMode.RGB: 'rgb'>}, this will stop working in Home Assistant Core 2025.3, please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+strip_controller%22 -
Implement unloading device and/or entities in order to avoid error like this:
2024-06-17 19:44:54.054 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry asd for strip_controller Traceback (most recent call last): File "/Users/brunopiaggio/git/ha-core/homeassistant/config_entries.py", line 809, in async_unload result = await component.async_unload_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/brunopiaggio/git/ha-core/homeassistant/components/strip_controller/__init__.py", line 81, in async_unload_entry hass.data[DOMAIN].pop(entry.entry_id) KeyError: '01J0KFV6RXM6685D42PZWB7WB1' `` -
Set custom icon/logo upgrade HA version to 2024.x and set icon (more info: https://developers.home-assistant.io/blog/2024/01/19/icon-translations/).
-
Create OptionsFlow to edit sections (check homeassistant/components/met/config_flow.py).
- Actualmente solo se puede prender o apagar toda la tira. Buscar la forma de hacerlo por secciones. Para esto hay que buscar la forma de mantener el inicio y fin de cada sección. Algunas opciones son: como parámetro de aplicación de AppDaemon o como atributo de cada entidad que se crea publicando un mensaje a un tópico de MQTT.
- Consider adding a new attribute
typein responses to make easier to decode them, for instance using mashumaro discriminators (see "Subclasses distinguishable by a field" on mashumaro official documentation).
-
Traduction file
-
Improve
font-sizedefinition to avoid issues with em and rem units (for example definefont-sizeinhtmltag and use onlyrem). -
Display sc-master server logs (generated by DRF) on the frontend. It may be better to include more attributes on sc-master command responses. For example when executing a
/turn_oncommand on sc-master, the output could be something like this :{ "code": "SC_RPI_ERROR", "device_name": "raspberry", "command": "turn_on" "status": 400 }where the
400indicates the status returned by raspberry after executing theturn_on(sc-rpi) command (think of trying to turn on more than one device, raspberry and raspberry2 by executing theturn_onfor both devices). -
Send raw commands (as stringified JSONs) directly to sc-rpi.
- Scan stores in all
src/pages/*instead of manually adding them as instance attributes inRootStoreclass.