spaceapid: adjustments to 3d printer state sensors #8

Merged
june merged 1 commit from dx/nix-infra:3d-printer-state-part-2 into main 2024-10-27 17:06:05 +01:00
Member
  • Prefix sensor names with ext_ as the spec says we should use that for
    extensions (this also improves attribute access for tools that don't
    like fields starting with a number)
  • Rename printer state to printer busy state, to make it clearer.
  • Add ext_3d_printer_minutes_remaining sensors

Talked to @bendodroid and got some feedback to refine this

This is marked as WIP because it requires changes in home assistant:

  1. The last two steps that hit the REST endpoint to update 3d_printer_state should now hit ext_3d_printer_busy_state
  2. ext_3d_printer_minutes_remaining needs a new automation that triggers every minute when a printer is printing. The tricky part of this one is that we get the finish time in absolute time from the entity, and we want to turn that into relative time in minutes. I don't know how difficult this is, likely involves writing some pseudopython in the jinja value template.

The first change is a breaking change (of an unannounced feature that only i am using currently), but it is easy enough. If someone wants to do that for me, this can be merged and deployed.

The second one can stay as 0 until the next time I visit club and implement that. (Unless, of course, someone else wants to take that challenge)

- Prefix sensor names with ext_ as the spec says we should use that for extensions (this also improves attribute access for tools that don't like fields starting with a number) - Rename printer state to printer busy state, to make it clearer. - Add ext_3d_printer_minutes_remaining sensors ---- Talked to @bendodroid and got some feedback to refine this This is marked as WIP because it requires changes in home assistant: 1. The last two steps that hit the REST endpoint to update `3d_printer_state` should now hit `ext_3d_printer_busy_state` 2. `ext_3d_printer_minutes_remaining` needs a new automation that triggers every minute when a printer is printing. The tricky part of this one is that we get the finish time in absolute time from the entity, and we want to turn that into relative time in minutes. I don't know how difficult this is, likely involves writing some pseudopython in the jinja value template. The first change is a breaking change (of an unannounced feature that only i am using currently), but it is easy enough. If someone wants to do that for me, this can be merged and deployed. The second one can stay as 0 until the next time I visit club and implement that. (Unless, of course, someone else wants to take that challenge)
june approved these changes 2024-08-17 23:25:10 +02:00
june left a comment
Owner

Looks good!

Looks good!
Author
Member

Okay handling of time in templates is well documented and looks doable: https://www.home-assistant.io/docs/configuration/templating/#time

Okay handling of time in templates is well documented and looks doable: https://www.home-assistant.io/docs/configuration/templating/#time
dx changed title from WIP: spaceapid: adjustments to 3d printer state sensors to spaceapid: adjustments to 3d printer state sensors 2024-10-03 16:05:11 +02:00
dx force-pushed 3d-printer-state-part-2 from 80a543aaf3 to 8305b8319f 2024-10-03 16:17:41 +02:00 Compare
dx force-pushed 3d-printer-state-part-2 from 8305b8319f to 9d1521c485 2024-10-24 16:25:52 +02:00 Compare
Author
Member

I rebased this, can I have a merge please? :3

I rebased this, can I have a merge please? :3
june merged commit 9d1521c485 into main 2024-10-27 17:06:05 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: CCCHH/nix-infra#8
No description provided.