Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate param1,param2 to json (power switch, light switch, staircasetimer) #857

Closed
przemyslawzygmunt opened this issue Aug 14, 2024 · 6 comments
Assignees

Comments

@przemyslawzygmunt
Copy link
Member

No description provided.

@przemyslawzygmunt
Copy link
Member Author

SUPLA_CHANNELFNC_LIGHTSWITCH
SUPLA_CHANNELFNC_POWERSWITCH

param1 -> relatedMeterChannelId

SUPLA_CHANNELFNC_STAIRCASETIMER

param2 -> relatedMeterChannelId

@przemyslawzygmunt
Copy link
Member Author

Disconnecting the channel should not remove the "relatedMeterChannelId" key from the json but should set its value to null.

@fracz
Copy link
Member

fracz commented Aug 24, 2024

Kanał, który był wskazywany (IC lub EM) ustawiał w param4 też wskazanie na kanał, który mierzy. Czy tam też mam to przenieść do JSONa? @przemyslawzygmunt

@przemyslawzygmunt
Copy link
Member Author

przemyslawzygmunt commented Aug 24, 2024

param4 można na razie zostawić. Chyba, że chcesz to od razu posprzątać to możemy zmigrować z tym, że nie mam tego po mojej stronie na razie ogarniętego. Co więcej urządzenie teraz może samo ustawić relatedMeterChannelId i teraz myślę, że param4 będzie problemem bo się nie ustawia. Zresztą wcześniej mROW też ustawiał param1/param2 i pomijał param4 :/

@przemyslawzygmunt
Copy link
Member Author

UPDATE supla_dev_channel SET param1 = 0, user_config = JSON_SET(IFNULL(NULLIF(user_config,''),'{}'), '$.relatedMeterChannelId', param1) WHERE (func = 130 OR func = 140) AND param1 > 0;
UPDATE supla_dev_channel SET param2 = 0, user_config = JSON_SET(IFNULL(NULLIF(user_config,''),'{}'), '$.relatedMeterChannelId', param2) WHERE func = 300 AND param2 > 0;

@fracz
Copy link
Member

fracz commented Aug 24, 2024

Generalnie ta ucieczka z paramsów do jsona w przypadku gdy chodzi o identyfikatory nie jest taka trywialna, bo w oparciu o to działa mechanizm wykrywania zależności przy zmianach, filtrowania itp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants