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

[Bug] linkedTypes not cached #130

Closed
crbyxwpzfl opened this issue Apr 9, 2022 · 16 comments
Closed

[Bug] linkedTypes not cached #130

crbyxwpzfl opened this issue Apr 9, 2022 · 16 comments
Assignees
Labels

Comments

@crbyxwpzfl
Copy link

I use the linkedTypes to combine two lights together into one device.
This works very good.
But when I restart homebridge the Light2/seconde device/linkedType device is no longer responding.
I need to clear the cache for the Device via homebridge settings first.
After that the Light2/seconde device/linkedType device works again.

You helped me a lot of times at this point and I really feel greatfull for that!
I have no idea how big this issue is and I can easaly clear the cache after reboots.
anyway Thank you verymuch for your work and this amzing plugin!

Config:

"platform": "Cmd4",
"name": "Cmd4", 
"debug": false,
"accessories": [{
    "type": "Lightbulb",
    "displayName": "Light1",
    "on": 0,
    "stateChangeResponseTime": 1,
    "brightness": 100,
    "hue": 200,
    "saturation": 100,
    "state_cmd": "...",
    "polling": [... ],
    "linkedTypes": [{
        "type": "Lightbulb",
        "displayName": "Light2",
        "on": 0,
        "brightness": 0,
        "stateChangeResponseTime": 1,
        "state_cmd": "...",
        "polling": [... ]
        }]
    }]

Environment:

  • Node.js Version: v16.14.0
  • NPM Version: v8.3.1
  • Homebridge Version: v1.4.0
  • homebridge-cmd4 Version: v6.1.2
  • Operating System: macOS
  • Process Supervisor: hb-service
@ztalbot2000
Copy link
Owner

ztalbot2000 commented Apr 9, 2022 via email

@crbyxwpzfl
Copy link
Author

thank you! hey is there a way to support you? Do you have PayPal?

@ztalbot2000
Copy link
Owner

hi, I do this for fun. no charge, but thanks.

From what I can tell, you are correct. I used your config, cleared the .persist and accessories sub folders from .homebridge. I see the all important debug message adding get?set Priority values. however after shutting down and restarting, the linked types are added, but I do not see these messages. I will have to investigate further. so far I just reproduced it on my Mac

take care,
John Talbot

@crbyxwpzfl
Copy link
Author

ok thanks again haha
and thanks for the update really appreciate your efforts

@ztalbot2000
Copy link
Owner

Hi,

So I'm still looking into it. When Cmd4 creates the devices service initially, it works as you know. Upon restore, the service is created by homebridge and it fails to work. I'm still investigating.
Sorry for the delay as I'm deep in the bowels of homebridge.

@ztalbot2000
Copy link
Owner

interesting how some times writing the problem out gives you ideas. I just had a working restart based on reading some documentation on what I described to you. here's hoping that I found the real answer.

@ztalbot2000
Copy link
Owner

can you please try 6.3.0-beta.1

@crbyxwpzfl
Copy link
Author

hi just did a couple restarts and all worked!!
wow you are quick!
this is so cool of you that you care so much even about niche issues like this!
just came home and tried your update sorry for the late answer.

@ztalbot2000
Copy link
Owner

ztalbot2000 commented Apr 14, 2022 via email

@mitch7391
Copy link
Collaborator

@ztalbot2000 I have not tried this beta out yet sorry! Yes, I am very surprised we have not noticed the issue yet. As far as I am aware, we have had no issue with linkedTypes. I am using a Thermostat with a linkedType Fan and I believe Ung Sing is using a Fan with a linkedType Switch from memory.

@ztalbot2000
Copy link
Owner

ztalbot2000 commented Apr 16, 2022 via email

@ztalbot2000
Copy link
Owner

ztalbot2000 commented Apr 16, 2022 via email

@crbyxwpzfl
Copy link
Author

really great! thank you very much!
so I close this right haha

@ztalbot2000
Copy link
Owner

ztalbot2000 commented Apr 16, 2022 via email

@ztalbot2000
Copy link
Owner

Hi,

Just to let you know I merged into master test/Cmd4PlatformRestartTests.js, a unit test that proves the fix previously provided. It just means that future changes will make sure this fix is still working.

take care,
John Talbot

@crbyxwpzfl
Copy link
Author

hi your communication is really great!
just updated the plugin to master again and everything works very well.
hope you have a nice weekend!

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

No branches or pull requests

3 participants