Closed Habbie closed 8 months ago
Maybe simply call it "remote.py" so that transmitter could be added in future?
It's a separate component/block for esphome, makes sense to leave them as separate files. I also don't think anything Tuya comes with transmit stuff in the config, that's all programmable stuff.
The modules aren't named by ESPHome components, but by parts of upk data.
The modules aren't named by ESPHome components, but by parts of upk data.
ok, ir
then?
ir
means infrared only, but reality tells us that RF is used here too. So remote
seems appropriate to me.
EDIT: lint checks are failing now, please run black
on the project code
renamed, blacked
Here's an interesting one: https://tuya-cloudcutter.github.io/api/devices/tuya-generic-ir-rf-universal-remote-controller-v2.0.8.json
"device_configuration": {
"crc": 88,
"infre": 7,
"infrr": 8,
"netnc": 0,
"netyc": 1,
"owm": 0,
"rf_study_feq": 0,
"rsthold": 3,
"wfst_lv": 1,
"wfst_pin": 9
},
Apparently it supports both IR and RF, not sure how. Is this a receiver or a transmitter? No idea, but there are both infre
and infrr
keys.
Logs from a different (but similar) IR/RF bridge device:
[01-01 18:12:15 TUYA Notice][lr:0x595b5] pConfig = {reset_pin:26,wfst_pin:24,owm:1,reset_lv:0,rsthold:3,wfst_lv:1,netyc:1,infrr:8,netnc:0,infre:7,crc:32,}---config len:103
[01-01 18:12:16 TUYA Notice][lr:0x59709] key:reset_pin:-----val:26----len:1
[01-01 18:12:16 TUYA Notice][lr:0x59709] key:reset_lv:-----val:0----len:1
[01-01 18:12:16 TUYA Notice][lr:0x59709] key:infre:-----val:7----len:1
[01-01 18:12:16 TUYA Notice][lr:0x59709] key:infrr:-----val:8----len:1
[01-01 18:12:16 TUYA Notice][lr:0x59709] key:wfst_pin:-----val:24----len:1
[01-01 18:12:16 TUYA Notice][lr:0x59709] key:wfst_lv:-----val:1----len:1
[01-01 18:12:16 TUYA Notice][lr:0x59709] key:rsthold:-----val:3----len:1
[01-01 18:12:16 TUYA Notice][lr:0x59709] key:owm:-----val:1----len:1
[01-01 18:12:16 TUYA Notice][lr:0x59709] key:netyc:-----val:1----len:1
[01-01 18:12:16 TUYA Notice][lr:0x59709] key:netnc:-----val:0----len:1
[01-01 18:12:16 TUYA Notice][lr:0x594c7] ir_send =7
[01-01 18:12:16 TUYA Notice][lr:0x594cf] ir_recv =8
[01-01 18:12:16 TUYA Notice][lr:0x594d7] owm =1
[01-01 18:12:16 TUYA Notice][lr:0x594df] led detect_sta =1
[01-01 18:12:16 TUYA Notice][lr:0x594e7] led_num =24
[01-01 18:12:16 TUYA Notice][lr:0x594ef] netn =0
[01-01 18:12:16 TUYA Notice][lr:0x594f7] nety =1
[01-01 18:12:16 TUYA Notice][lr:0x594ff] key detect_sta =0
[01-01 18:12:16 TUYA Notice][lr:0x59507] key_num =26
[01-01 18:12:16 TUYA Notice][lr:0x5950f] long_key_time =3
Oh, nevermind, they use a CMT2300A chip for RF. These pins are purely for IR RX/TX.
Correct, infre
and infrr
are infrared emit and infrared receive. RF is a separate module and not in the config, but on pins P26 & P6 on https://tuya-cloudcutter.github.io/api/devices/tuya-generic-ir-rf-universal-remote-controller-v2.0.8.json
ok, shall I do all of:
ir
and infrr
irfre
then?
ok, shall I do all of:
* generate receiver blocks for both `ir` and `infrr` * generate transmitter blocks for `irfre`
then?
Yes, that sounds correct.
@Habbie I've removed the copyright line for now, since there was my name and it was incorrect. If you want to add your name there, please comment or make a PR.
@Habbie I've removed the copyright line for now, since there was my name and it was incorrect. If you want to add your name there, please comment or make a PR.
ah yes, of course. I don't need my name there, git history is enough credit :)
Oh, I just noticed that yr.found = True
is missing, so it can throw a "Found no actual components" error for some devices.
Maybe simply call it "remote.py" so that transmitter could be added in future?
As for the copyright, feel free to put your name/nickname there, otherwise remove it (as I didn't write it haha).