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

TextWidget new secret feature (Request) #3

Open
t0mg opened this issue Mar 23, 2017 · 6 comments
Open

TextWidget new secret feature (Request) #3

t0mg opened this issue Mar 23, 2017 · 6 comments

Comments

@t0mg
Copy link
Collaborator

t0mg commented Mar 23, 2017

From @NietGiftig on January 31, 2017 14:18

Following up a discussion in the WindWidget pull request https://github.com/t0mg/reacticz/pull/45
about showing data in reacticz

if it is only about showing bits of information in Reacticz, there is a "in between" solution.
Make in the txt widget a routine that can divide the text into parts.
Lets say, if the txt begins with the magic word 'qyz'
Take the first part of the txt until a divider for example '~' and show it on row 1
Do the same for the next 2 lines of text so you can have 2 or 3 lines of Text in your own "Style".
The normal user never sees it or has to use it, but the well informed ones can use it for their own benefits.
They only have to fill a txt device in domoticz (Lua etc) with the data divided in rows they want to show in Reacticz
No further settings in Reacticz required.>

t0mg added to these remarks the sentence:

We could also provide a syntax to select an icon so that you can look like an alert, contact, watt, wind, etc widget. <

witch would be a tremendous advantage to some people ;-)

Copied from original issue: t0mg/reacticz#47

@t0mg
Copy link
Collaborator Author

t0mg commented Mar 23, 2017

This is a nice idea for "advanced users". I think we need to agree on the requirements and exact syntax before writing some code.

I don't have a lot of bandwidth so it'd be great if we found volunteers to make this change and/or write some documentation in the wiki as well (syntax, supported icons).

Note: please assign yourself on the issue if you want to contribute so that we don't work in parallel :)

@t0mg
Copy link
Collaborator Author

t0mg commented Mar 23, 2017

From @NietGiftig on January 31, 2017 15:8

I have no idea how to assign myself.
As I'm not useful for .js coding, rather not in the coding part, it would make it more difficult for others.
I not a Icon man, but use Icons in the Reacticz style, if nessecary I wil go on Icon hunt ;-)
In the wiki I can do some documentation bits, as soon as I know what direction to go.
Basic requirements in my view:

  • No Widget name as first row, use if you want the fist row for that. (possible bold if user wants to)
  • max 3 rows, if less, good vertically spaced.
  • To much text sorry, make you widget wider on screen.
  • Choice for to not use Icon.
  • Do not scale icon part, icon always the same width if you change the width on screen.

@t0mg
Copy link
Collaborator Author

t0mg commented Mar 23, 2017

I disagree on the bold styling :) Styling should not be handled in multiple uncorrelated places.
For the rest it's fine by me (btw, by default there is no icon in TextWidget, so no need for an option to hide it).

I still don't have time to implement this but here's a proof of concept for passing special options in the text value: https://jsfiddle.net/gh9tnva5/

This function turns a string like "[rctz]option1=value1,option2=value2[/rctz]" into a JS object {option1: "value1", option2: "value2"} or returns null if no secret option was found.

In Reacticz TextWidget, we could parse the string either from the device name or from the text value and once we have the object it would be easy to apply the options to set an icon or customize the text content.
We just need to define the options :) hideName and icon are the only two I can think of right now.

Re. icon scaling, that's a fair point but I don't think it should be customizable, we should simply fix it globally by setting a max size on icons in GenericWidget.

@davidlb
Copy link
Collaborator

davidlb commented Nov 15, 2017

Domoticz now supports multiple lines for Text and Alert devices (domoticz/domoticz#1942)

@NietGiftig
Copy link
Contributor

Nice!
I'm still using Reacticz with same old version of Domotizc
Still very, very pleased with it, for me proof that it is not always necessary to change things.
I'm reluctant to update Domoticz, there are so many changes not sure if it will not break my current use.
I will have another look on updating when I have more time at hand.

@t0mg
Copy link
Collaborator Author

t0mg commented Nov 15, 2017

Thanks for the heads up @davidlb - So at some point Reacticz should also be updated to support \n and \r and render them as
. Probably in GenericWidget.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants