timroemisch / mqtt-s7-connector

Connect Siemens S7 to Mqtt with Homeassistant discovery support
ISC License
19 stars 9 forks source link

Add write_back feature and write queue #5

Closed lsibilla closed 3 years ago

lsibilla commented 3 years ago

Hello,

When using both plc_address and plc_set_address, it can become handy to keep data at plc_set_address at the same state as data at plc_address.

This PR adds an optional write_back configuration flag to implement this feature.

It also fixes an inconsistency when using plc_set_address where data is readen from the plc_set_address instead of plc_address.

lsibilla commented 3 years ago

Hi,

If several items are true at startup, it tried to write back all at once which ended up in write failure as concurrent write is not supported.

I implemented a write queue to fix this issue and removed the write lock in attribute.js.

timroemisch commented 3 years ago

Hi,

I like your Pull Request !
I looked through your Code and tested it with my setup.

You can add your Username to the Contributors List in the package.json File.
After that I´m going to merge it to the master branch.

lsibilla commented 3 years ago

Hi, I just added me as contributor.

I also added a small improvement I made during the week-end.

Thank you for accepting the contribution.

timroemisch commented 3 years ago

thank you for contributing ! 😄