Closed nagyrobi closed 5 months ago
The proposed solution would require a complete rewrite of the template engine...
I'm thinking about:
- obj: "p3b30" # tab dots
event:
"changed":
- service: openhasp.update
data:
plate: openhasp.openhasp_plate_6fe4fc
property: p3b26.text
value: >
{% if val == 0 %}
{{ "#000000 \u2022# #909090 \u2022# #909090 \u2022#" | e }}
{%-elif val == 1 %}
{{ "#909090 \u2022# #000000 \u2022# #909090 \u2022#" | e }}
{%-elif val == 2 %}
{{ "#909090 \u2022# #909090 \u2022# #000000 \u2022#" | e }}
{% endif %}
Perhaps making the plate
key optional, defaulting from the context to the current plate. So you only need to specify it if the object is on a different plate.
Service really requires the plate….
On 12 Jun 2021, at 14:13, nagyrobi @.***> wrote:
Perhaps making the plate key optional, defaulting from the context to the current plate. So you only need to specify it if the object is on a different plate.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
Service really requires the plate
Sure, when outside the CC, in an automation. But when you parse it in your own code, you can substitute it (if none then self.plate etc.)
Services are called using async_call_from_config (it reads directly from the yaml the service call)
I would need to patch the yaml file before calling... and would be confusing because we would have a service call in yaml that is different from the normal service call...
I see
If we can do without templates maybe something like:
bindings: p3b30.text: p3b26.text
And the cc would sync the two properties
We need some kind of templates to be able to make it more universal. In the example above, we set the text property of an object based on the val property of another object.
Well actually if you pull in the command service, that can already fulfill your logic the way it is - if it's not possible to make it more compact/efficient.
This could be partially solved with https://github.com/HASwitchPlate/openHASP-custom-component/issues/63 .
Is your feature request related to a problem? Please describe. Currently properties of an object can be linked only to values coming from entities in Home Assistant. We also need a way to directly link properties of an object to events coming from the (same) plate's other objects too.
Describe alternatives you've considered For example, I have a tabview with 3 tabs, and a label:
Switching between the tabs is done by swiping left and right. The label shows 3 dots, the goal is to highlight the the dot corresponding to the tab.
This can be achieved with some trickery:
input_select
in HA in order to just track the state of the tabview, and based on its value, set the label property. This is an overkill...mqtt.publish
to the plate's topic (see example below). The problem is that this kind of communication goes outside the component.Describe the solution you'd like Since data goes back to the same plate, something more efficient could be implemented, like:
Additional context https://discord.com/channels/538814618106331137/692393568266092617/852874097653186579 https://haswitchplate.github.io/openHASP-docs/0.6/integrations/home-assistant/sampl_conf/#generic-thermostatclimate