Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using moisture sensors to control programs
#21
Thanks for the test report.
I will look into the missing log entries.

By the way I have taken a quick look at your moisture_sensor plugin. I really like how it can accept sensor data from different sensor types through additional plugins.
<p><br></p>
Reply
#22
I cannot install the moisture_sensor_data_mqtt plugin because 

1.) the following code in plugin_manager.py

Code:
            short_list = [
                x for x in file_list if not "data" in x and not "manifest" in x
            ]

The check 'if not "data"' filters out all the entries from the manifest file giving a empty list.

Code:
moisture_sensor_data_mqtt.py plugins
moisture_sensor_data_mqtt.html templates
moisture_sensor_data_mqtt-docs.html static/docs/plugins
moisture_sensor_data_mqtt.json data (generated)
moisture_sensor_data_mqtt.manifest plugins/manifests
moisture_sensor_data_chart.json data/simple_chart

if I change the check to  'if not " data "' (which probably is not correct) I can install the plugin but I cannot enable the plugin.

2.) I require the python module jmespath
Does this need to be added by hand or can it be included in the base SIP install?
Reply
#23
for #1: could you possibly rename your plugin files to something like moisture_sensor_info_mqtt.*? I know this could be a real pain. I will look for another solution.

for #2 The jmespath module looks pretty useful. I will consider adding it to the base SIP install even though I prefer to keep things as small and simple as possible.

Edit:
I think the best solution for 1 would be to replace
Code:
short_list = [
x for x in file_list if not "data" in x and not "manifest" in x
]
with
Code:
short_list = []
for line in file_list:
    parts = line.split()
    if (not parts[1] == "data"
       and not parts[1] == "plugins/manifests"
        ):
        short_list.append(line)
Still need to do some testing.
<p><br></p>
Reply
#24
The code change looks like it should work, if you need help testing let me know.

I have completed my testing and only found one issue, where I think we had a misunderstanding concerning the functionality of gv.rn. It does not make sense for the  moisture_sensor_control plugin to have any influence on manual schedules, i.e. RUN NOW and RUN ONCE, however gv.rn is only set for RUN NOW and not for RUN ONCE. If you run a schedule manually it should not be blocked by a plugin.

Apart from this issue and the ones mentioned in the previous post as far as I'm concerned the pull request containing the moisture_sensor_data_mqtt and the moisture_sensor_control plugins can be merged.
Reply
#25
I pushed the plugin_manager change and added the jmespath/ module to the SIP install.
<p><br></p>
Reply
#26
In my opinion there is still a bug in the sub directory creation code of install_plugins() as the code assumes that all sub directories will be created under plugins/. The new plugins however required sub directories under data/ 

I have provided a PR with a proposed fix and a few other minor changes/improvements.

On another subject any ideas why email notifications from the forum do not work?
Reply
#27
Thank you for the bug fix and code improvements. Your work on the new plugins is greatly appreciated. They add some amazing capabilities.

The forum is graciously provided by a SIP user and I don't have full admin rights so I can't address the email notification problem.
<p><br></p>
Reply
#28
I installed the moisture_sensor_data_mqtt plugin and tried submitting the settings without adding a topic. This resulted in an "internal server error" page to be shown.

Could there be a more user friendly way to indicate this type of error such as an alert box?
<p><br></p>
Reply
#29
I will take a look tomorrow

EDIT
I could not reproduce the issue, can you provide more details/the logs

   

EDIT 2
I was able to reproduce the issue, will provide a fix this weekend.

EDIT 3
PR is available
Reply
#30
(2024 Mar 14, 07:39 PM)cdesouza Wrote: I will take a look tomorrow

EDIT
I could not reproduce the issue, can you provide more details/the logs



EDIT 2
I was able to reproduce the issue, will provide a fix this weekend.

EDIT 3
PR is available

Thank you. The PR is merged.
<p><br></p>
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)