#still unavailable

1 messages ยท Page 1 of 1 (latest)

hot wedge
#

Weird. Anything in the logs?
With debug of twinkly enabled?

dry sable
#

let me fire up debugging

#

nothing that looks errorish

2022-12-02 11:21:56.291 DEBUG (MainThread) [custom_components.twinkly.light] Updating 'Twinkly_6A5D49.collective.lan'
2022-12-02 11:21:56.291 DEBUG (MainThread) [ttls.client] Authentication token still valid
2022-12-02 11:21:56.291 DEBUG (MainThread) [ttls.client] GET endpoint led/mode
2022-12-02 11:21:56.320 DEBUG (MainThread) [ttls.client] GET response 200
2022-12-02 11:21:56.320 DEBUG (MainThread) [ttls.client] Authentication token still valid
2022-12-02 11:21:56.320 DEBUG (MainThread) [ttls.client] GET endpoint led/out/brightness
2022-12-02 11:21:56.400 DEBUG (MainThread) [ttls.client] GET response 200
2022-12-02 11:21:56.400 DEBUG (MainThread) [ttls.client] Authentication token still valid
2022-12-02 11:21:56.400 DEBUG (MainThread) [ttls.client] GET endpoint gestalt
2022-12-02 11:21:56.425 DEBUG (MainThread) [ttls.client] GET response 200
2022-12-02 11:21:56.425 DEBUG (MainThread) [ttls.client] Authentication token still valid
2022-12-02 11:21:56.425 DEBUG (MainThread) [ttls.client] GET endpoint movies
2022-12-02 11:22:29.432 DEBUG (MainThread) [custom_components.twinkly.light] Updating 'Twinkly_6A5D49.collective.lan'
2022-12-02 11:22:29.432 DEBUG (MainThread) [ttls.client] Authentication token still valid
2022-12-02 11:22:29.432 DEBUG (MainThread) [ttls.client] GET endpoint led/mode
2022-12-02 11:22:29.467 DEBUG (MainThread) [ttls.client] GET response 200
2022-12-02 11:22:29.467 DEBUG (MainThread) [ttls.client] Authentication token still valid
2022-12-02 11:22:29.467 DEBUG (MainThread) [ttls.client] GET endpoint led/out/brightness
2022-12-02 11:22:29.495 DEBUG (MainThread) [ttls.client] GET response 200
2022-12-02 11:22:29.495 DEBUG (MainThread) [ttls.client] Authentication token still valid
2022-12-02 11:22:29.495 DEBUG (MainThread) [ttls.client] GET endpoint gestalt
2022-12-02 11:22:29.515 DEBUG (MainThread) [ttls.client] GET response 200
2022-12-02 11:22:29.515 DEBUG (MainThread) [ttls.client] Authentication token still valid
2022-12-02 11:22:29.515 DEBUG (MainThread) [ttls.client] GET endpoint movies
hot wedge
#

No exceptions or anythng?

dry sable
#

nope

#

there's 0 debug logging in the integration

hot wedge
#

I added some debug lines in the latest PRs

dry sable
#

i see it in the get movies stuff

hot wedge
#

Yes. They should show up just after the "Get endpoint movies" probably

dry sable
#

nothing happens after that

#

re-ran the script too:

== Setting color ==
## Cant set color ##
404, message='Not Found', url=URL('http://twinkly_6a5d49.collective.lan/xled/v1/led/color')
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fb2e93b7d90>
== Setting color done ==
## Cant get movies ##
Server disconnected
## Cant get current movie ##
Server disconnected
Traceback (most recent call last):
  File "/home/firstof9/twinkly.py", line 65, in <module>
    asyncio.run(main_loop())
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/home/firstof9/twinkly.py", line 45, in main_loop
    if 'movies' in mov and curr:
TypeError: argument of type 'NoneType' is not iterable
Unclosed client session
#

here's the get_mode reply:
{'code': 1000, 'mode': 'movie', 'shop_mode': 0}

#

"led/movie/config":

{'code': 1000,
 'frame_delay': 67,
 'frames_number': 45,
 'leds_number': 435,
 'loop_type': 0,
 'sync': {'master_id': '', 'mode': 'none', 'slave_id': ''}}
hot wedge
#

Mhm. Just dont understand why you cant see the debug lines and why it does not work

hot wedge
#

DId you replace light.py with the one from the last PR?

dry sable
#

yup

hot wedge
#

Does it continue with the updates, or did it jst run once?

dry sable
#

the async_update function keeps getting called

hot wedge
#

Pushed a new file now to the same PR, a bit more error-logging

dry sable
#

I'm pin pointing where the issue is but I think it may have something to do with this block:

            for key, value in device_info.items():
                if key not in HIDDEN_DEV_VALUES:
                    self._attributes[key] = value

            if LightEntityFeature.EFFECT in self.supported_features:
                await self.async_update_movies()
                await self.async_update_current_movie()
hot wedge
#

The first three lines have not changed. The last three are added in 2022.12

#

At first run, the if should return true, but the two functions below should fail, and unset the EFFECT feature

dry sable
#

ya i added some "echo" debugs just to see where it's getting hung up

#

because it seems to never fall out to self._is_available = True

hot wedge
#

It could be that the async_update_movies() never returns?

#

That would be the same function as this from the script

Cant get movies

Server disconnected

dry sable
#

yup it's failing at that if block

#
            if LightEntityFeature.EFFECT in self.supported_features:
                await self.async_update_movies()
                await self.async_update_current_movie()
hot wedge
#

So... I need to add another test to check if that is available

dry sable
#

ya like

if movies not in get_movies:
  self.supported_features = None
#

something like that I'd think

#

the older version I could set colors so ๐Ÿคทโ€โ™‚๏ธ

hot wedge
#

I just need a way to check if the feature is available without turning the lights on or breaking something else

dry sable
#

i've not really dug into the API on this stuff, I assume you're reverse engineering it

hot wedge
#

Whant happens if you curl http://twinkly_6a5d49.collective.lan/xled/v1/movies

dry sable
#

curl: (52) Empty reply from server

#

/xled/v1/led/mode: {'code': 1000, 'mode': 'enabled', 'value': 50}

#

maybe base it on FW version?

#
curl http://twinkly_6a5d49.collective.lan/xled/v1/fw/version
{"version":"2.3.5","code":1000}
hot wedge
#

Probably the best

#

That is the latest fw for your?

#

(Pushed a new version now)

#

Seems like 2.7.1 is the first with all of this

dry sable
#

just grabbed it and restarting HA now

hot wedge
#

New version coming up with version testing instead

#

But if the one you are testing now works, this shoud work as well, as the only difference is that I check for the version instead of another parameter I found

dry sable
#

it does become available and controllable

hot wedge
#

Excellent

#

Unfortunately, you won't get the effects control with that version

dry sable
#

that's fine

#

I'm keeping the tree till it stops working hehe

hot wedge
#

Was that with the latest fix, or the previous?

dry sable
#

previous

#

you want me to give the latest a go?

hot wedge
#

Thanks a lot for testing btw

dry sable
#

sure no problem man

hot wedge
#

Pleas, if you don't mind restarting again

dry sable
#

downloading now

hot wedge
#

So we can close that bug and get it into it to b3 or something

dry sable
#

make sure to poke Frenk about it to get added to the beta ๐Ÿ™‚

#

new version works too

hot wedge
#

Thanks again. Need a break now

hot wedge
#

Got a review from balloob, and have implemented all of his comments. Rewrote quite a bit of code. But should still work for you, I hope.

dry sable
#

dropping the files in and restarting to test ๐Ÿ™‚

hot wedge
#

๐Ÿ‘

dry sable
#

yup still works

#

could go for a firmware field in the device info later on just for good measure ๐Ÿ˜›

hot wedge
#

It's coming.
I have a PR ready for that as well, but it depends on this one to be merged first.

#

I am adding full diagnostics support to the integration

#
GitHub

Proposed change

This should bring back support for older devices that was broken with the new effects functions.
Type of change

Dependency upgrade
Bugfix (non-breaking change which fixes an is...

GitHub

The problem Twinkly device unavailable after update to latest beta. What version of Home Assistant Core has the issue? core-2022.12.0b0 What was the last working version of Home Assistant Core? cor...

hot wedge
#

Thanks. Balloob already approved it, so I am just waiting for the merge and I'll add the diagnostics PR as well