Skip to content
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

Basic GUI for Sensors #84

Merged
merged 18 commits into from
Nov 29, 2021
Merged

Basic GUI for Sensors #84

merged 18 commits into from
Nov 29, 2021

Conversation

pfefferle
Copy link

@pfefferle pfefferle commented Oct 21, 2021

Description

If you ask about a state of a (binary)sensor, it will display the value in a very basic form.

image

image

Type of PR

  • Bugfix
  • Feature implementation
  • Refactor of code (without functional changes)
  • Documentation improvements
  • Test improvements

Testing

Say "What is the value of {Binary Sensors Name}."

@pfefferle
Copy link
Author

I will also add binary sensors when #82 is merged.

@pfefferle pfefferle marked this pull request as draft October 22, 2021 08:37
@stratus-ss
Copy link
Collaborator

@krisgesling can you take a look at this? I am not familiar with the GUI

@pfefferle pfefferle marked this pull request as ready for review October 25, 2021 17:16
@pfefferle
Copy link
Author

Added binary_sensor support

image

image

@pfefferle
Copy link
Author

It seems that the background image is persistant and stays also on other GUIs like settings or naptime.

@krisgesling is skillBackgroundSource the wrong method or do I miss a reset function?

Copy link

@krisgesling krisgesling left a comment

Choose a reason for hiding this comment

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

Hey, exciting to see GUI elements coming in!

The image remaining across Skills is something we have to look at. Not a problem with your implementation. However I've made some little suggestions below that should work better.

I've also wondered if we should add an intent to display the HomeAssistants own GUI.
There's a handy self.gui.show_url() method.

ui/sensors.qml Outdated Show resolved Hide resolved
ui/sensors.qml Outdated Show resolved Hide resolved
__init__.py Outdated Show resolved Hide resolved
@pfefferle
Copy link
Author

I've also wondered if we should add an intent to display the HomeAssistants own GUI. There's a handy self.gui.show_url() method.

@krisgesling I had a very similar idea, but wanted to start it as a stand alone skill, because I was not sure if it fits: https://github.com/pfefferle/skill-open-homeassistant

But now I will skip the idea and add it directly to this plugin.

@pfefferle
Copy link
Author

@krisgesling see #91

@pfefferle
Copy link
Author

@krisgesling works perfect, thanks for the feedback!

@AIIX
Copy link

AIIX commented Oct 28, 2021

Can this be done natively in QML UI rather than using a webpage? For example, it would be nice to have something like this instead of opening a website
devices-ui-1
devices-ui-2

@krisgesling
Copy link

Yeah to clarify, I didn't mean to use the web view instead of QML. Personally, I'd like us to end up with native QML views for all of the interactions, state reporting etc. And you could obviously toggle things from the GUI like turning lights on and off.

I think where the web view comes in is that a lot of HomeAssistant users have already spent a lot of time designing custom interfaces that suit their personal setup. So it would be good to let them use those same GUI's on their Mycroft devices if they have them and want to. These might be based on location groupings like everything in the kitchen, or to serve different functional purposes like alarm / cctv monitoring.

It will require some thinking around how we people can configure what is shown when, and I don't know how well they will display on a small screen, or if there's a way to show a lovelace view without the nav header which takes up a bunch of room especially if you have multiple tabs.

Also pinging @dschweppe as I know he's keen to input around the design side of things.

@pfefferle
Copy link
Author

Should we open an issue for that? I think it is far bigger than the scope of that PR. I simply wanted to add a visual to the status check of the several sensors.

@krisgesling can you re-review my changes?

@AIIX
Copy link

AIIX commented Oct 28, 2021

Should we open an issue for that? I think it is far bigger than the scope of that PR. I simply wanted to add a visual to the status check of the several sensors.

#93

@pfefferle
Copy link
Author

"Open Home Assistant" was added with #91

Copy link

@krisgesling krisgesling left a comment

Choose a reason for hiding this comment

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

Looks good - I haven't run it on an install so would be great if someone could do that - but the new Github Actions should also catch any major issues.

The GUI looks good on the few sizes I tested.

Small optional suggestion below

Comment on lines +593 to +594
sensor_states = self.translate_namedvalues(
'homeassistant.sensor.cover.state')

Choose a reason for hiding this comment

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

Could move these to initialize() so we only have to do it once

Choose a reason for hiding this comment

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

Tests are passing so I'll merge this - and refactoring can happen in a follow up PR if there's interest in it.

@krisgesling krisgesling added the secure Code has been reviewed and is safe to execute in Github Actions. label Nov 29, 2021
@github-actions github-actions bot removed the secure Code has been reviewed and is safe to execute in Github Actions. label Nov 29, 2021
@krisgesling krisgesling merged commit 43c49c9 into MycroftAI:20.08 Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants