ratgdo / esphome-ratgdo

ratgdo for ESPHome
GNU General Public License v2.0
310 stars 79 forks source link

Update potentially wrong client_ids #93

Closed mariusmuja closed 6 months ago

mariusmuja commented 6 months ago

Ensure existing ratgdo client_ids end with 0x539.

bdraco commented 6 months ago

Will test shortly. I still have my flasher connected so can test much more quickly. I will also test a remote in service one

bdraco commented 6 months ago

Set it to 42, reflashed, got 39064890.0

bdraco commented 6 months ago

Thanks @mariusmuja

bdraco commented 6 months ago
Screenshot 2023-11-05 at 6 13 26 PM

Just noticed we need to increase the max. Will PR it in a moment

mariusmuja commented 6 months ago

Yeah, just noticed that too...

mariusmuja commented 6 months ago

Oh, the number sensor is not a good fit for this setting (unless we restrict the size of the client_id). Currently it's 28 bits (2 bytes followed by 0x539) and that cannot always be represented by a float precisely (because not enough bits in the fraction part).

bdraco commented 6 months ago

I think its fine to restrict the size of the client id. It just needs to be random enough that its unlikely they hit a collision when switching between firmware types

I don't think https://github.com/esphome/issues/issues/2875 is going to be solved any time soon

jfroy commented 6 months ago

I can confirm my client ID was also automatically updated. 👍