Skip to content

Add an interface to handle img#52

Open
LePailleurThibault wants to merge 1 commit intomainfrom
feature/img_interface
Open

Add an interface to handle img#52
LePailleurThibault wants to merge 1 commit intomainfrom
feature/img_interface

Conversation

@LePailleurThibault
Copy link
Contributor

No description provided.

return TopicGenerator._make_topic(BASE_IMG_RESPONSE, cmd, params)

@staticmethod
def make_img_set_config_response_topic(gw_id="+", sub_config="+"):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a weird value for gw_id :suspect:

Copy link
Contributor Author

@LePailleurThibault LePailleurThibault Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😅
Well it's part of the topic, it's not on me

logging.info("Upload img image in the MQTT broker")
wni.upload_img_image(args.image_id, image_binary.read(), chunk_size=args.chunk_size, app_version=args.app_version)

sleep(2)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WHy do we need to wait here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't want the script to exit before sending the message to the MQTT broker

1)
return self._wait_for_response(cb, request.req_id, param=param)

def upload_img_image(self, image_id, image_binary, chunk_size, app_version, differential_image=False):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a maximum chunk size for the IMG ?
If so it could be good to add an error if the limit is reached ? WDYT ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, but if there is, it must be MQTT broker dependant.

@GwendalRaoul GwendalRaoul self-requested a review August 29, 2025 14:11
Copy link
Contributor

@GwendalRaoul GwendalRaoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me it doesn't make sense to add it to wirepas_network_interface.py.

The only common part is that it uses a mqtt connection.

It could stay in same library but please make a dedicated interface.

wirepas_gateway_management_interface.py ?

wirepas_network_interface will be too huge with everything bundled.

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.

3 participants