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

Allow changes to the devices/hub through MQTT #20

Merged
merged 4 commits into from
Jan 20, 2022
Merged

Allow changes to the devices/hub through MQTT #20

merged 4 commits into from
Jan 20, 2022

Conversation

Skons
Copy link
Collaborator

@Skons Skons commented Jan 14, 2022

This update allows for changes to the hub or devices through MQTT, to facilitate that a few changes had to be made. There are also other improvements. These are all the changes in this PR

  • Disable hub alarm through MQTT
  • Enable test alarm of a device through MQTT
  • Rename a device through MQTT
  • It is no longer needed to provide the ID, it can now be fabricated from the mac address of the hub
  • The help shows the difference between required and optional
  • All known ID's are know used for the DeviceType
  • The DeviceType is reported as type_name in the MQTT payload
  • The state of an AlarmSensor is now reported properly
  • The readme is updated, it also accomodates the previous PR
  • The protocol documentation has been updated by things I found
  • Tests almost fully updated to the latest changes

One thing that i could not do was to write a proper test for the handle_device_messages, because I do not know how to do that properly.

I believe the following issues are addresses (maybe partially)
#12
#18
#7

@Skons Skons mentioned this pull request Jan 16, 2022
@depuits
Copy link
Collaborator

depuits commented Jan 18, 2022

This looks amazing. The only thing we wouldn't be able to do which is possible in the app is removing/replacing a device.

When enabling a test alarm can it then also be disabled through the hub like a normal alarm?

@Skons
Copy link
Collaborator Author

Skons commented Jan 18, 2022

Replacing and/or removing can be done (i think), but i did not want to make this change to big. I was planning on implementing after this PR was approved.

I do not know about a real alarm, but as far as i know when you send a test alarm to your device with the app, you cannot silence the device. You can only silence the hub. The implementation of this PR is equal to that.

I have seen that the state of a device can be changed, but i did not take a deep dive into that, also because i could not really find that in the app. The only state that is set by the app, is the test alarm state.

Copy link
Collaborator

@hildensia hildensia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Only had minor comments.

elro/mqtt.py Outdated Show resolved Hide resolved
elro/mqtt.py Outdated Show resolved Hide resolved
elro/utils.py Outdated Show resolved Hide resolved
@hildensia
Copy link
Collaborator

Sorry. I think that solution is fine.

elro/mqtt.py Outdated Show resolved Hide resolved
elro/mqtt.py Outdated Show resolved Hide resolved
@hildensia hildensia merged commit f3539db into dib0:master Jan 20, 2022
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