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

Optimization #421

Merged
merged 3 commits into from
Nov 22, 2024
Merged

Optimization #421

merged 3 commits into from
Nov 22, 2024

Conversation

mattreim
Copy link
Contributor

@mattreim mattreim commented Nov 21, 2024

@Jey-Cee Also fixes code:400 warning when creating dimspeed and the jump from bri to 1 when selecting dimup/dimdown before the device is on.

@mattreim mattreim changed the title Optimization and bug fixes Optimization Nov 21, 2024
@mattreim
Copy link
Contributor Author

mattreim commented Nov 22, 2024

@Jey-Cee Now I've tried a few things again with a fresh installation and only have this one-time warning. What do you think of it?

warn | State "deconz.0.Sensors.5.buttonpressed" has no existing object, this might lead to an error in future versions

@Jey-Cee
Copy link
Owner

Jey-Cee commented Nov 22, 2024

Without any context it isnt easy to say anything about this message.

@mattreim
Copy link
Contributor Author

This message always appears the first time a switch is pressed and then no longer appears. But actually I meant the PR.

@mattreim
Copy link
Contributor Author

I always test the changes with a new installation to detect errors early.

@mattreim
Copy link
Contributor Author

mattreim commented Nov 22, 2024

Changes:

  • Removing transitiontime from on and stop (boolean)
  • Add default to dimspeed (Fix code:400 warning when creating dimspeed)
  • Add , "on": true to dimup/dimdown (Fix the jump from bri to 1 when selecting dimup/dimdown before the device is on)
  • Add transitiontime min even 0
  • Remove transitiontime from group list["state"] and blind
  • Formatting

@Jey-Cee
Copy link
Owner

Jey-Cee commented Nov 22, 2024

Transition time is available on groups, so there is no reason to remove it. -> https://dresden-elektronik.github.io/deconz-rest-doc/endpoints/groups/#set-group-state

@mattreim
Copy link
Contributor Author

mattreim commented Nov 22, 2024

I didn't delete it from action but from state.

list["action"]

ioBroker.deconz/main.js

Lines 995 to 1003 in 42c781f

let count2 = Object.keys(list["action"]).length - 1;
//create states for light device
for (let z = 0; z <= count2; z++) {
let stateName = Object.keys(list["action"])[z];
await SetObjectAndState(groupId, list["name"], "Groups", stateName, list["action"][stateName]);
if (!list["uniqueid"]) {
await SetObjectAndState(groupId, list["name"], "Groups", "transitiontime", null);
}
}

list["state"]:

ioBroker.deconz/main.js

Lines 1004 to 1009 in 42c781f

let count3 = Object.keys(list["state"]).length - 1;
//create states for light device
for (let z = 0; z <= count3; z++) {
let stateName = Object.keys(list["state"])[z];
await SetObjectAndState(groupId, list["name"], "Groups", stateName, list["state"][stateName]);
}

So it still works.

@mattreim
Copy link
Contributor Author

mattreim commented Nov 22, 2024

The list["state"] are two boolean in groups or not? Can be seen in the picture.

  • all_on
  • any_on

Group

@Jey-Cee
Copy link
Owner

Jey-Cee commented Nov 22, 2024

State are two boolean in groups or not?

Sorry i dont understand the question.

@mattreim
Copy link
Contributor Author

I hope it's more understandable now.

@Jey-Cee
Copy link
Owner

Jey-Cee commented Nov 22, 2024

Yes, they are two booleans.

@mattreim
Copy link
Contributor Author

Transition time is available on groups, so there is no reason to remove it.

That was the basic question and no, these two booleans have no transition time.

@mattreim
Copy link
Contributor Author

But otherwise the PR is ok or should I change something else?

@Jey-Cee
Copy link
Owner

Jey-Cee commented Nov 22, 2024

no its ok. Please update version and write the changelog, then we can release a beta for testing.

@mattreim
Copy link
Contributor Author

It's done

@Jey-Cee Jey-Cee merged commit 136f25d into Jey-Cee:master Nov 22, 2024
10 checks passed
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.

2 participants