marvingrieger / ioBroker.haassohn

This is an adapter for ioBroker that enables to control Haas+Sohn devices.
MIT License
8 stars 7 forks source link

ECO mode writeable #61

Open shaarkys opened 8 months ago

shaarkys commented 8 months ago

Hi again, not sure it's done correctly (not a developer and ChatGPT is able to do mistakes very well ;-) ) but it works for me :

Please cherry pick or reject, up to you - I will be not touching this for some moment now ;-)

marvingrieger commented 8 months ago

Hey,

in this solution, the eco mode is always writable, even it is not supported. The check whether setting eco mode is supported or not only occurs when the state is toggled. If it is not supported, a hard error is thrown. I guess this would work (need to test it though), but it is not very elegant. In my opinion, it would be better to perform the check initially when initializing the states. The state should only be made writable if its is supported by the device. Can you implement it in this way?

Also, the test breaks since the version in package.json needs to be bumped to v1.0.14 (i.e., it is inconsistent to the version in io-package.json.

Best regards

shaarkys commented 8 months ago

but it is not very elegant. In my opinion, it would be better to perform the check initially when initializing the states. The state should only be made writable if its is supported by the device. Can you implement it in this way?

Unfortunately this is outside my limits ;-) I'm using iOBroker almost just because of HaasSohn adapter , which feeds my Homey Pro 2023 via MQTT... enabling ECO mode from time to time, so I thought I will have a look. But continue developing something I do not understand so much, it might be dangerous ;-)

the test breaks since the version in package.json needs to be bumped to v1.0.14 (i.e., it is inconsistent to the version in io-package.json.

Will fix, I was wondering but haven't seen the error/cause....