lwitzani / homebridgeStatusWidget

MIT License
375 stars 143 forks source link

SytaxError on line 573 #24

Closed panthertom closed 3 years ago

panthertom commented 3 years ago

Hi,

since a few days I got an error : 2020-11-30 08:37:18: Error on line 573: SyntaxError: Unexpected token '{'. Expected ')' to end an 'if' condition. As far as I can check the code everything is fine and unchanged.

this are the lines: function useCredentialsFromWidgetParameter(givenParameter) { if (givenParameter.includes(',,')) { let credentials = givenParameter.split(',,'); if (credentials.length === 3 && credentials[0].length > 0 && credentials[1].length > 0 && credentials[2].length > 0 && credentials[2].startsWith('http')) { CONFIGURATION.userName = credentials[0].trim(); CONFIGURATION.password = credentials[1].trim(); CONFIGURATION.hbServiceMachineBaseUrl = credentials[2].trim(); return true; } } return false; }

my credentials are OK and proved. BTW: the IP Adress was changed by my router, so I checked the IP-Adress, which is fine.

Thanks for you support and Thanks for that beautiful script! Kind Regards Thomas

lwitzani commented 3 years ago

I don’t see any problem with this code.

It seems that you use the widget with providing the credentials via parameter. So you could try deleting the configuration jaon that was created in your icloud folder. Go to your icloud folder of Scriptable and then the homebridge status widget folder and there delete the configuration json that was automatically created (i think default name is purple.json) ? Also you can try setting the variable usePersistedConfiguration to false! (overwritePersistedConfig should be false in productive use any way)

Also i would recommend to again get the code and set it up in a new Script just to be sure that there is really not anything missing in the code.

I just tried everything on my phone and it works for me

panthertom commented 3 years ago

Hi, something with the purple.js and the rest must have gone wrong. I delete all scripable files and reinstalled scripable. New script is generated.

Now it works like a charm. Perhaps the new IP makes some troubles beside the pure IP address.

Thanks again for your support. Kind reagards