Skip to content

Conversation

@execreate
Copy link

Hey there, thanks a lot for the nice tool! I've noticed there is a minor thing with datetime parsing that can be improved. The current implementation throws the following error:

Traceback (most recent call last):
  File "/myproject/venv/lib/python3.10/site-packages/IPython/core/interactiveshell.py", line 3550, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-5-0cf0aa12b443>", line 1, in <module>
    twin = manager.get_twin("my_device")
  File "/myproject/venv/lib/python3.10/site-packages/azure_iot_hub_api/azure_iot_hub.py", line 34, in get_twin
    return Twin.from_dictionary(result)
  File "/myproject/venv/lib/python3.10/site-packages/azure_iot_hub_api/models.py", line 167, in from_dictionary
    status_update_time = datetime.fromisoformat(twin_dictionary.get("statusUpdateTime"))
ValueError: Invalid isoformat string: '2025-01-27T16:35:04.6698773Z'

This pull request should fix this.

@birddevelper birddevelper self-requested a review April 3, 2025 09:50
@birddevelper birddevelper merged commit f442952 into birddevelper:main Apr 3, 2025
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 this pull request may close these issues.

2 participants