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

ResourceType not serializable #407

Open
BenoitAnastay opened this issue Sep 16, 2024 · 3 comments · May be fixed by #445
Open

ResourceType not serializable #407

BenoitAnastay opened this issue Sep 16, 2024 · 3 comments · May be fixed by #445

Comments

@BenoitAnastay
Copy link

I tried to update scenes actions but I had to rewrite ResourceIdentifier to use string instead of ResourceType
What I did to be able to update my scenes : https://gist.github.com/BenoitAnastay/2b1a53b04c3d1a7cc881eeea3439924d

@marcelveldt
Copy link
Collaborator

I don't understand this report. Can you be more descriptive ?

@BenoitAnastay
Copy link
Author

When I need to use ScenePut, to update a scene I get the error ResourceType not serializable so I had to rewrite ResourceIdentifier to have rtype as string.

The ResourceType class is not converted to string (serialised) when the request is sent to the hue API.

In my exemple I had to use string instead of class to makes it work rtype='light'

@BenoitAnastay
Copy link
Author

Maybe we need to update this line with

class ResourceTypes(str, Enum):

class ResourceTypes(Enum):

BenoitAnastay added a commit to BenoitAnastay/aiohue that referenced this issue Nov 27, 2024
For API calls with ResourceTypes as arguments, this Enum must be converted to string.

PR not tested as I'm on my phone 

Fix home-assistant-libs#407
@BenoitAnastay BenoitAnastay linked a pull request Nov 27, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants