ssieb / esphome_components

My collection of components for esphome
Other
198 stars 125 forks source link

Another problem with magic_switch component #68

Open snaulh opened 8 months ago

snaulh commented 8 months ago

_

[11:30:52][D][magic_switch:019]: detected pulse of 29027us [11:30:52][D][light:036]: 'Light' Setting: [11:30:52][D][light:047]: State: ON [11:30:54][D][magic_switch:019]: detected pulse of 4591us [11:30:54][D][light:036]: 'Light' Setting: [11:30:54][D][light:047]: State: OFF [11:30:54][D][magic_switch:019]: detected pulse of 3782us [11:30:54][D][light:036]: 'Light' Setting: [11:30:54][D][light:047]: State: ON [11:30:54][D][magic_switch:019]: detected pulse of 68933us [11:30:54][D][light:036]: 'Light' Setting: [11:30:54][D][light:047]: State: OFF [11:30:56][D][magic_switch:019]: detected pulse of 33690us [11:30:56][D][light:036]: 'Light' Setting: [11:30:56][D][light:047]: State: ON [11:30:58][D][magic_switch:019]: detected pulse of 1769us [11:30:58][D][light:036]: 'Light' Setting: [11:30:58][D][light:047]: State: OFF [11:30:58][D][magic_switch:019]: detected pulse of 58900us [11:30:58][D][light:036]: 'Light' Setting: [11:30:58][D][light:047]: State: ON [11:30:59][D][magic_switch:019]: detected pulse of 5286us [11:30:59][D][light:036]: 'Light' Setting: [11:30:59][D][light:047]: State: OFF [11:30:59][D][magic_switch:019]: detected pulse of 3193us [11:30:59][D][light:036]: 'Light' Setting: [11:30:59][D][light:047]: State: ON [11:31:00][D][magic_switch:019]: detected pulse of 2352us [11:31:00][D][light:036]: 'Light' Setting: [11:31:00][D][light:047]: State: OFF [11:31:00][D][magic_switch:019]: detected pulse of 8931us [11:31:00][D][light:036]: 'Light' Setting: [11:31:00][D][light:047]: State: ON [11:31:00][D][magic_switch:019]: detected pulse of 9989us [11:31:00][D][light:036]: 'Light' Setting: [11:31:00][D][light:047]: State: OFF

_

As you can see in above log, at the same time, magic_switch is trigger several times, that leads to sometimes switch status cannot be reverted I tried some time_out setting but if I set it like 12-13ms, sometime it cannot recognize pulse, but if set smaller, sometime it detect multiple pulse I just wonder is there any case to delay detecting new pulse right after one pulse detected and detect again after 1 or few seconds Thank you.