fmartinou / tydom2mqtt

Deltadore Tydom to MQTT Bridge
https://fmartinou.github.io/tydom2mqtt/
MIT License
90 stars 53 forks source link

issue with windowSliding detectors #56

Closed denisvinciguerra closed 1 year ago

denisvinciguerra commented 1 year ago

Hi,

I have k-line detectors in my k-line windows.

I have made some debug: they seem to be detected as "windowSliding" (and not "klineWindowSliding"), see json below:

      {
         "id_device":1549571289,
         "last_usage":"windowSliding",
         "id_endpoint":1549571289,
         "picto":"picto_detect_window_sliding1",
         "name":"Detector 4",
         "anticipation_start":false,
         "first_usage":"window"
      },

Changing following lines in tydomMessageHandler.py worked on my tests:

line 567:

                            if type_of_id == 'windowFrench' or type_of_id == 'window' or type_of_id == 'klineWindowFrench' or type_of_id == 'klineWindowSliding' or type_of_id == 'windowSliding':

line 402:

            if i["last_usage"] == 'shutter' or i["last_usage"] == 'klineShutter' or i["last_usage"] == 'light' or i["last_usage"] == 'window' or i["last_usage"] == 'windowFrench' or i["last_usage"] == 'windowSliding' or i["last_usage"] == 'belmDoor' or i[

log from test after bugfix:

2022-11-24 03:11:32,791 - tydomMessagehandler - INFO - Incoming data parsed successfully !
2022-11-24 03:11:55,819 - sensors - INFO - Sensor created / updated : openState_tydom__D▒tecteur_4 LOCKED
2022-11-24 03:11:55,819 - tydomMessagehandler - INFO - Incoming data parsed successfully !

Thanks a lot for your work ! Code was interesting and easy to check, especially as I have never developed in Python.

fmartinou commented 1 year ago

Hi,

Thank you very much for the contribution 👍 !

It's released as 2.6.4