-
Notifications
You must be signed in to change notification settings - Fork 3k
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
More entity improvement #675
Conversation
Do we really want to go in the preact direction? I didn't actually try it, so I'm not aware of the advantages, but the disadvantages I see are:
|
For this PR: All the logic here is added in Polymer components. The preact components are just pointing at the polymer components.
It is very very similar. The only thing that is transpiled is that The reason I went for Preact for the automation/script editor is because of speed and as an interoperability experiment. Dynamically figuring out which component to render is just a lot more straightforward in Preact. I don't have to do something like this for each type: <template is='dom-if' if='[[isTriggerState(row)]]'>
<trigger-state-editor
hass='[[hass]]'
trigger='{{trigger}}'
></trigger-state-editor>
</template> but instead can do this to match all types at once (since it's JS): const Comp = TYPES[row.type];
return <Comp hass={hass} trigger={trigger} /> We could probably rewrite this using I'm not against removing Preact. I just don't feel like doing it 😉 |
The polymer part looks fine. I don't quite understand the preact part :) |
The preact part is rendering the new component and dealing with the data that comes out of it. If you want we can jump on a call and I can give you a preact 101. |
Is this ok to merge? |
ok to merge. I understand the theory, it is just much harder (relative to Polymer) to follow that everything is correct. |
* Update script and automation editor to use entity picker * Add entity and service picker to service dev panel * Lint
* Ignore hass changes while dropdown is open * Upgrade vaadin-combo-box * Fix styling on dev-service panel * Fix styling for ha-entity-dropdown * Fix height vaadin-combo-box dropdown * Rename ha-entity-dropdown to ha-entity-picker * More entity improvement (#675) * Update script and automation editor to use entity picker * Add entity and service picker to service dev panel * Lint
This PR depends on #674 so this PR merges into that branch.
In the automation editor: when configuring a zone we only autocomplete entities that have a location.