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

PR 235 Rebased off of Dev #252

Closed
wants to merge 63 commits into from
Closed

Conversation

krkeegan
Copy link
Collaborator

Fixing a PR based off of master.

#235

krkeegan and others added 30 commits March 2, 2020 11:04
Significant improvements to the IOLinc:

- Tracks the state of both the sensor and the relay.
- Changes the MQTT Payload to contain the sensor and relay states
by default.
- Enables the writing of flags to the device.  This design matches
how it is defined in the Insteon Documentation and also matches
how the Insteon App handles this.  The old code did not set any
flags for me.  I would be surprised if it worked on any device.
- Tracks the flags in persistent storage.  This enables things
like momentary changes and linked to relay to be enabled by
future work.
Relatively simple design.

Does not guarantee accuracy.  Only that the call will not be made
prior to the scheduled time.
Turns off the relay after momentary_secs if momentary mode is
enabled.  There is a slight delay, as the TimedCall feature
is not a true asynch system, but it is very close and I think
within reasonable expectations.

Only turns on the relay if the proper Momentary conditions are
met.

Turn on relay if relay_linked is set and sensor is activated.

I believe this completes the modeling of the IOLinc in software.
With the exception of the "Set Button" all interactions accurately
track the IOLinc.
I don't think hijacking the simulated scene call and translating
it into a modem scene was a good idea.

- It required creating a scene that would get picked up by
import_scenes and could confuse users.
- It was unnecessary for many use cases.
- It still didn't properly reflect all use cases as it didn't
allow the user to specify the on_level for D1 and so therefore
Momentary_A and Momemtary_C uses may not have been correct.

I think it is better to redirect users to create a proper scene
for their device and to provide them with the documentation on
how to do that.
I have really never done unit tests before this project.  I am
starting to get a better idea of the tools available.

I believe these are more thorough and less duplicate code than
my prior work.

However, still never sure if I am "fully" testing the appropriate
aspects.
If a label can be found for a device in the entry use it,
otherwise will default to just the addr.

Fix the group spacing on Modem Entries to be consistent.

Add coverage tests for Entry label
Everything should send through Device.Send for two reasons:

1.In order to properly calculate outgoing hop counts.  (This change
may fix some latent errors we had not noticed.)

2. In order to enable caching outgoing messages for battery devices

Add a send() function to the Modem device for consistencey with
devices.
This was a proposed function for use by the Scene Sync feature,
we ended up using a different function.
No need to pass protocol or device as the database object
already has the device object
This way device can properly set hop counts and the device
can queue messages for battery devices.
Queue messages to battery devices.  Start sending them when the
device sends a broadcast.

Add a search function to protocol so that we only try and send
one message at a time to the battery devices.
Need to check response is an ACK or NAK otherwise the handler
may unintentionnaly handle a broadcast command with bad results.
Queue for when the device is awake, which is assume to be right
after it sends a message.
This is necessary to enable the awake functionality.

Generally just required minor changes the handle_broadcast
to accomidate this.
Adds a signal to Protocol that emits on a write_msg Msg.FINISHED
after the message has been removed from the _write_queue

Battery device listens to Msg_Finished signal and dequeues a
msg from _send_queue if necessary.  This is cleaner than injecting
into the on_done and actually works.  The on_done method doesn't
work correctly with handlers and sequences that do not call
on_done until a series of messages have been transmitted.
This is weird this has been working fine, and certainly passed
the tests previously.
krkeegan and others added 28 commits December 12, 2020 12:20
Add a Queuing System for Messages Sent to Battery Devices
Increment Database Delta on Writing
Print Device Names When Printing a Device's Database
Check the Remote Battery Periodically and Report to Low Battery Topic
The keypad and dimmer support a default ramp rate to be set.
Co-authored-by: tstabrawa <59430211+tstabrawa@users.noreply.github.com>
Co-authored-by: tstabrawa <59430211+tstabrawa@users.noreply.github.com>
Co-authored-by: tstabrawa <59430211+tstabrawa@users.noreply.github.com>
The rate is now passed in as float in seconds ranging from 0.1 to 540
@krkeegan krkeegan closed this Dec 14, 2020
@krkeegan krkeegan deleted the Add_Ramp_Rate branch December 17, 2020 20:27
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.

3 participants