(solved) Store Variable for Hardware

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
wernieman
Normal user
Posts: 13
Joined: 03 Jun 2018, 20:42

(solved) Store Variable for Hardware

#1 Post by wernieman » 23 Oct 2018, 13:49

Hey,

Sorry this is my first work on the Code and I have a "little" Question

I work for the "Init" Problem for the PCA9685
https://github.com/letscontrolit/ESPEasy/issues/651
viewtopic.php?f=5&t=851&p=4466&hilit=PCA9685#p4454

1) I must expand the WebFrontend -> No Problem
2) there must be 2 Boolean for Driver and Invert -> No Problem
3) For Future Expand this will be Store in a byte (mode2) -> No Problem
4) When you Submit the WebFrontend, it must be save (in PLUGIN_WEBFORM_SAVE?), but how?
5) In the INIT Prozedure the mode2 must be use for the Init (in the Theorie no Problem)

My Problem is 4), how do I save? I try to look in other Files, but ... I don't find how ....
and Hov it could be init with the default, wehnn it it open for the first time / deklariation of the Device?

Cloud somebody give me a little help?

Mercy ... and sorry about my english ...

Greeting,
Werner
Last edited by wernieman on 24 Oct 2018, 18:07, edited 1 time in total.

wernieman
Normal user
Posts: 13
Joined: 03 Jun 2018, 20:42

Re: Store Variable for Hardware

#2 Post by wernieman » 23 Oct 2018, 18:13

Hey,

I think about my question and it would better to ask:

How is the best way in ESPEasy, to safe a Variable for a Device...

Greeting,
Werner

TD-er
Core team member
Posts: 8759
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Store Variable for Hardware

#3 Post by TD-er » 24 Oct 2018, 12:07

Isn't this just about the same as is being done in this Pull request : https://github.com/letscontrolit/ESPEasy/pull/1944

I still have to look at that one, but it may be merged in 1 or 2 days.

wernieman
Normal user
Posts: 13
Joined: 03 Jun 2018, 20:42

Re: Store Variable for Hardware

#4 Post by wernieman » 24 Oct 2018, 18:07

Yes ...I try it, because:
- I want to solve it (for me)
- and I want to learn, how espeasy work (intent).

Today I solve my Problem ....

I have:
- 2 Check box on the WebBox
- Save it in a Variable for the Init-Routine

At the Moment I have the Problems:
- how to rerun the INIT-Routine, when you change it
- When you define the Device, how to set the default. At the Moment the Variable is 0 ....


But I think, your Code would be better than my ... if you would, I could give you a diff ...

wernieman
Normal user
Posts: 13
Joined: 03 Jun 2018, 20:42

Re: (solved) Store Variable for Hardware

#5 Post by wernieman » 25 Oct 2018, 09:23

I make a patch from my last Version and put it to github ....

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests