Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/1.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
SebRut committed Jun 5, 2022
2 parents fb4f1f7 + dd4f61b commit 4c85a48
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## [v1.3.0](https://github.com/SebRut/pygrocy/tree/v1.3.0) (2022-06-05)

[Full Changelog](https://github.com/SebRut/pygrocy/compare/v1.2.1...v1.3.0)

**Merged pull requests:**

- Fix int type for amount and price floats [\#239](https://github.com/SebRut/pygrocy/pull/239) ([marcelvriend](https://github.com/marcelvriend))
- Update responses requirement from ~=0.19.0 to ~=0.21.0 [\#238](https://github.com/SebRut/pygrocy/pull/238) ([dependabot[bot]](https://github.com/apps/dependabot))

## [v1.2.1](https://github.com/SebRut/pygrocy/tree/v1.2.1) (2022-05-21)

[Full Changelog](https://github.com/SebRut/pygrocy/compare/v1.2.0...v1.2.1)
Expand Down
12 changes: 6 additions & 6 deletions pygrocy/grocy.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ def consume_product(
def inventory_product(
self,
product_id: int,
new_amount: int,
new_amount: float,
best_before_date: datetime = None,
shopping_location_id: int = None,
location_id: int = None,
price: int = None,
price: float = None,
get_details: bool = True,
) -> Product:
product = Product(
Expand Down Expand Up @@ -215,10 +215,10 @@ def consume_product_by_barcode(
def inventory_product_by_barcode(
self,
barcode: str,
new_amount: int,
new_amount: float,
best_before_date: datetime = None,
location_id: int = None,
price: int = None,
price: float = None,
get_details: bool = True,
) -> Product:
product = Product(
Expand Down Expand Up @@ -247,7 +247,7 @@ def add_product_to_shopping_list(
self,
product_id: int,
shopping_list_id: int = None,
amount: int = None,
amount: float = None,
quantity_unit_id: int = None,
):
return self._api_client.add_product_to_shopping_list(
Expand All @@ -258,7 +258,7 @@ def clear_shopping_list(self, shopping_list_id: int = 1):
return self._api_client.clear_shopping_list(shopping_list_id)

def remove_product_in_shopping_list(
self, product_id: int, shopping_list_id: int = 1, amount: int = 1
self, product_id: int, shopping_list_id: int = 1, amount: float = 1
):
return self._api_client.remove_product_in_shopping_list(
product_id, shopping_list_id, amount
Expand Down
14 changes: 7 additions & 7 deletions pygrocy/grocy_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ class ProductBarcodeData(BaseModel):
class ProductDetailsResponse(BaseModel):
last_purchased: Optional[date] = None
last_used: Optional[date] = None
stock_amount: int
stock_amount_opened: int
stock_amount: float
stock_amount_opened: float
next_best_before_date: Optional[date] = None
last_price: Optional[float] = None
product: ProductData
Expand Down Expand Up @@ -251,7 +251,7 @@ class MealPlanSectionResponse(BaseModel):
class StockLogResponse(BaseModel):
id: int
product_id: int
amount: int
amount: float
best_before_date: date
purchased_date: date
used_date: Optional[date] = None
Expand Down Expand Up @@ -447,7 +447,7 @@ def inventory_product(
best_before_date: datetime = None,
shopping_location_id: int = None,
location_id: int = None,
price: int = None,
price: float = None,
):
data = {
"new_amount": new_amount,
Expand Down Expand Up @@ -523,7 +523,7 @@ def inventory_product_by_barcode(
new_amount: float,
best_before_date: datetime = None,
location_id: int = None,
price: int = None,
price: float = None,
):
data = {
"new_amount": new_amount,
Expand Down Expand Up @@ -563,7 +563,7 @@ def add_product_to_shopping_list(
self,
product_id: int,
shopping_list_id: int = 1,
amount: int = 1,
amount: float = 1,
quantity_unit_id: int = None,
):
data = {
Expand All @@ -581,7 +581,7 @@ def clear_shopping_list(self, shopping_list_id: int = 1):
self._do_post_request("stock/shoppinglist/clear", data)

def remove_product_in_shopping_list(
self, product_id: int, shopping_list_id: int = 1, amount: int = 1
self, product_id: int, shopping_list_id: int = 1, amount: float = 1
):
data = {
"product_id": product_id,
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
responses~=0.19.0
responses~=0.21.0
pre-commit
isort
pytest
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="pygrocy",
version="1.2.1",
version="1.3.0",
author="Sebastian Rutofski",
author_email="[email protected]",
description="",
Expand Down

0 comments on commit 4c85a48

Please sign in to comment.