Skip to content

Add product picture to ozw node dashboard#7203

Merged
zsarnett merged 4 commits intohome-assistant:devfrom
cgarwood:ozw_node_dashboard_picture
Oct 15, 2020
Merged

Add product picture to ozw node dashboard#7203
zsarnett merged 4 commits intohome-assistant:devfrom
cgarwood:ozw_node_dashboard_picture

Conversation

@cgarwood
Copy link
Member

@cgarwood cgarwood commented Oct 2, 2020

Proposed change

OpenZWave provides a base64 version of the product picture for many different models of Z-Wave devices in the node metadata. This PR includes that image on the Node Dashboard in the config panel.

Using float feels dirty in 2020 but that seemed to end up with less code than trying to flexbox it.

Planning to do a separate PR to add this to the device page for ozw devices as well.

image
image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@bramkragten
Copy link
Member

What was the problem with flexbox? Seems like it should be easy?

@cgarwood
Copy link
Member Author

I couldn't figure out text wrapping, though in the current configuration text wrapping may not be necessary. I'll mess with it a little more and see what I can come up with.

@cgarwood cgarwood force-pushed the ozw_node_dashboard_picture branch from 952651c to f7b360b Compare October 13, 2020 14:55
@cgarwood
Copy link
Member Author

Converted from float to flexbox 👍

: ``}
</div>
<div class="product-image">
${this._metadata?.metadata.ProductPicBase64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we btw do this differently? Sending large files like images over the WebSocket is not recommended, would rather have just the URL or something.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OZW just has the base64 encoded image in the MQTT data for the node. Though I suppose we could register a regular HTTP endpoint on the backend to return the image instead of feeding it over the websocket. I've never done anything with custom endpoints like that in the backend though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something for a future PR maybe

@cgarwood
Copy link
Member Author

Ready for final review 👍

@zsarnett zsarnett merged commit 2dd7f29 into home-assistant:dev Oct 15, 2020
@bramkragten bramkragten mentioned this pull request Oct 21, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants