Doubledom45 / HA_RFPLAYER

Refonte ADDON RFPLAYER
4 stars 1 forks source link

Syntax error on rfplayer.send command with DOMIA #4

Closed loloweb06 closed 1 year ago

loloweb06 commented 1 year ago

Hello,

I have this error with this version. It does not occur with the original plugin. However, i do not get all entity with the original

service: rfplayer.send_command data: automatic_add: false command: "OFF" protocol: DOMIA device_id: "237"

image

To compare the syntax, it looks the command send is not following the same order.

With the original plugin, the log is the following and it works on the DOMIA plug

Pasted Graphic

Looking at the code, the issue looks to be here 👍 moving protocol before device id make it works on my Home assistant

(https://github.com/Doubledom45/HA_RFPLAYER/blob/67f6e49121cf3ac7591e4aa4d2383d31fb5316ee/custom_components/rfplayer/rflib/rfpprotocol.py#L199)

Corrections :

self.send_raw_packet(f"ZIA++{command} {protocol} ID {device_id} ") self.send_raw_packet(f"ZIA++{command} {protocol} ID {device_id} ")

Doubledom45 commented 1 year ago

Salut..

Permet d'avoir un ID qui représente le N° du Bp Limité au 256 premier ID (FIRMWARE)

## Test pour DOMIA ou chacon ID <256
            elif protocol == "DOMIA" or protocol == "CHACON" :
                    self.send_raw_packet(f"ZIA++{command} {device_id} {protocol}") # Permet d'avoir un ID qui représente le N° du Bp Limité au 256 premier ID (FIRMWARE)
            else :
                self.send_raw_packet(f"ZIA++{command} ID {device_id} {protocol}")

        elif device_address is not None:
            DIM_ADDON=""
            if command == "DIM" :
                DIM_ADDON="%50"
            self.send_raw_packet(f"ZIA++{command} {device_address} {protocol} {DIM_ADDON}")

        elif protocol == "EDISIOFRAME":
            self.send_raw_packet(f"ZIA++{protocol} {command}")

Version ne sera pas mise à jour , les envoies ne sont pas conformes ! Voir version de test !