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

Visually indication of the current mode (Summer / Winter) when modes is changed via msg #321

Closed
jonferreira opened this issue Sep 5, 2021 · 4 comments
Assignees
Labels
✓ already implemented Issue is already fixed/implemented in a newer Version (this Version is may be not published). 💡 enhancement New feature or request
Milestone

Comments

@jonferreira
Copy link

We currently have the "sun" and "snowmen?" icons showing the mode the node is is. However if the mode is changed via msg the icon doesn't change accordingly. AFAIK there's no visual way to quickly tell which mode a specific node is in?

Describe the solution you'd like
Change the icons according to the current mode the node is in

Describe alternatives you've considered
Add mode to the node.state

@Hypnos3 Hypnos3 self-assigned this Sep 6, 2021
@Hypnos3 Hypnos3 added the 💡 enhancement New feature or request label Sep 6, 2021
@Hypnos3
Copy link
Collaborator

Hypnos3 commented Sep 6, 2021

Maybe I can add the current mode to the node-status as well.

@jonferreira
Copy link
Author

that would be golden!

@jonferreira
Copy link
Author

Just put together a quick fix for this, not really worth a PR since it's probably not the "best" way to do it anyway:

`this.setState = blindCtrl => {
let code = node.reason.code;
let shape = 'ring';
let fill = 'yellow';
if (code === 10 && node.previousData) { // smooth;
code = node.previousData.reasonCode;
}

        if (blindCtrl.level === node.nodeData.levelTop) {
            shape = 'dot';
        }
        if (isNaN(code)) {
            fill = 'red'; // block
            shape = 'dot';
        } else if (code <= 3) {
            fill = 'blue'; // override
        } else if (code === 4 || code === 15 || code === 16) {
            fill = 'grey'; // rule
        } else if (code === 1 || code === 8) {
            fill = 'green'; // not in window or oversteerExceeded
        }
		
		let mode = '';
		
		if (node.sunData.mode === 1){
			mode = '❆';
			//mode = 'Winter ';
		} else if (node.sunData.mode === 2) {
			mode = '☼';
			//mode = 'Summer ';
		}

        node.reason.stateComplete = mode + ((isNaN(blindCtrl.level)) ? node.reason.state : blindCtrl.level.toString() + ' - ' + node.reason.state);
        node.status({
            fill,
            shape,
            text: node.reason.stateComplete
        });
    };`

@Hypnos3 Hypnos3 added this to the 2.0.0 milestone Sep 13, 2021
@Hypnos3 Hypnos3 added the ✓ already implemented Issue is already fixed/implemented in a newer Version (this Version is may be not published). label Sep 13, 2021
@Hypnos3
Copy link
Collaborator

Hypnos3 commented Sep 15, 2021

Is integrated in the 2.0.0-beta and can be installed, see Releases Information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✓ already implemented Issue is already fixed/implemented in a newer Version (this Version is may be not published). 💡 enhancement New feature or request
Development

No branches or pull requests

2 participants