lidl-plus icon indicating copy to clipboard operation
lidl-plus copied to clipboard

Set Favorite Market

Open Griffsano opened this issue 8 months ago • 1 comments

Hi,

thanks for providing this nice package. With feature #7 it's possible to automatically activate all coupons available to all markets. However, there may be coupons that are only available to the selected favorite market. In the app, this favorite market can be selected under settings.

Without setting a favorite market, the first part of the response of LidlPlusApi.coupons() looks like this: {'name': 'FavoriteStore', 'coupons': []} To automatically enable the coupons for the favorite market as well, it would be nice to support the selection of the favorite market per API.

By the way, in case someone runs into the same problem: Some LIDL coupon names are not UTF-8 compliant. This may lead to such an error when printing the coupon name: UnicodeEncodeError: 'latin-1' codec can't encode character '\u20ac' in position 1120: ordinal not in range(256) Therefore, it might be worth sanitizing the string before using it further. For me, the following encoding of the string worked: coupon["title"].encode('utf8', 'ignore')

Griffsano avatar Oct 14 '23 16:10 Griffsano