-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
[DO NOT MERGE!] [New feature]: Incorporate Delivery/Livraison bags #549
base: main
Are you sure you want to change the base?
Conversation
@@ -104,6 +106,15 @@ def _job(self) -> None: | |||
except TgtgAPIError as err: | |||
log.error(err) | |||
items += self._get_favorites() | |||
|
|||
# if state is empty (first scanning iteration), initialize it with the current favorite items |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SEE PR #548
@@ -221,3 +224,16 @@ def __getattribute__(self, __name: str) -> Any: | |||
if _type == "duration": | |||
return self._get_duration(_mode) | |||
raise | |||
|
|||
@classmethod | |||
def delivery_item_conversion(cls): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed because delivery bags have not the same attributes in the API call than Items
@@ -86,6 +86,9 @@ def __init__(self, data: dict, location: Union[Location, None] = None, locale: s | |||
store: dict = data.get("store", {}) | |||
self.store_name: str = store.get("store_name", "-") | |||
|
|||
self.manufacturer_properties: dict = data.get("manufacturer_properties", {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New attributes for delivery items
@@ -135,6 +148,41 @@ def _get_favorites(self) -> list[Item]: | |||
return [] | |||
return [Item(item, self.location, self.config.locale) for item in items] | |||
|
|||
def convert_raw_delivery_item(self, raw_delivery_item: dict, mapping: dict) -> Item: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conversion of delivery data, not in the same format as item data. Adding some logic to have correct format to build the Item object
"element_types_accepted": [ | ||
"ITEM", # All items/products in delivery | ||
"HIGHLIGHTED_ITEM", # Item with a special highlight on the top of the delivery pannel | ||
# "DUO_ITEMS", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not tested yet so still there but commented
Initial Implementation: Delivery Bag Notifications
This PR introduces a feature for receiving notifications related to new Delivery Bags. This is an early implementation, shared to prevent redundant work and foster collaboration. It’s not intended for immediate merging. This has been tested a few scanning runs. It works smoothly but requires more testing before merging. Further discussion is also needed to refine the scope of the feature for this project (CC @Der-Henning )
This PR is a first attempt to solve the following issues:
Resolves #533
Resolves #529
Key Changes
Workflow
Potential Improvements