Broadlink RM support

Currently I use HA-Bridge and the included Broadlink option to send RF and IR commands. but this requires another server running on my RPi or a dedicated Pi for HA-Bridge.
I’d like to eliminate the need for HA-Bridge and the extra server.
I have found multiple sample code in java and python both of which I know nothing about so things have been going slow trying to create something. Using code found here: https://github.com/mjg59/python-broadlink I’ve had success.
This is done using the files in the CLI folder.
I’m still playing so not sure if I’ll require a interface, custom widgets or both at this point.
It maybe possible to just create a program and use a generic light switch or dimmer widget.
I’ve not attempted to learn any new code but have successfully sent (armed and disarm) codes to my X10 security console with the Broadlink and a terminal input using code already learned elsewhere.

I managed to create a C# script which uses a generic light or switch widget. The program does a Broadlink discovery at each HG service start so finding the connection info is automatic.
I’ve only been testing this with RF code I’ve already captured and don’t intend on adding the learn function to this so someone else may wish to take this further.
I’ll test IR code sending later on but see no difficulty in sending as long as the code is correct.

for users wishing to play with this here is whats needed
1: Broadlink sending device see the above link in OP for what is supported
2: Python 2.7 the files are not formatted correctly for Python3
3: the Broadlink driver use sudo pip install Broadlink some users may need to install pip first.
4:make the folder HGbroadlink in /home/pi/
5:Copy files broadlink_discovery and broadlink_cli from https://github.com/mjg59/python-broadlink/tree/master/cli to your just created folder.
6: in stall Broadlink.hgx file in HG device and things.
1024-Broadlink_RM.hgx (5.2 KB)

7: restart HG service so Broadlink info is discovered and saved

Once the program is running you can add modules to your UI as with other devices .Once added you need to configure each module with the on/off codes by selecting
Broadlink RM under Features/Options

Although it is possible to learn IR and RF codes using the command line the program doesn’t do this. you need to find, discover codes and save them to be pasted into the on/off options for each device you wish to control.