diff --git a/CHANGELOG.md b/CHANGELOG.md index bf94828..24cfb10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog for Affaldshåndtering DK Home Assistant Integration + ## Version 2.0.7 + + **Date**: `2024-03-xx` + + ## What's Changed + +**NOTE**: A new category 'plast' has been added, so you will have to redownload the images files. + +- Removed Furesø kommune as they are no longer using Renoweb. Closing [#51](https://github.com/briis/affalddk/issues/51) +- Added Lejre kommune, that was left out in the initial release. Closing [#52](https://github.com/briis/affalddk/issues/52) +- Fixing wrong date count on sensors. Closing [#54](https://github.com/briis/affalddk/issues/54) +- Fixed categories for Solrød kommune. Closing [#53](https://github.com/briis/affalddk/issues/53) +- Fixing the `calendar.get_events` service call so that it now supports a start and end date. Thank you to @chamook for the initial Pull Request. +- Partly fix of #59. Catagorize container `Pap og papir/metal, glas og hård plast` correctly for Sorø Kommune +- Bumped minimum required HA version to 2024.2.0, to ensure that HA is using Python 3.12. Previous versions of Python might not work. +- Bump dependency `pyrenoweb` to 2.0.17 + +--------------------------- + +
+ PREVIOUS CHANGES + ## Version 2.0.6 **Date**: `2024-03-23` @@ -13,11 +35,6 @@ - Fixing occasionally wrong address id being returned. - Bump dependency `pyrenoweb` to 2.0.15 ---------------------------- - -
- PREVIOUS CHANGES - ## Version 2.0.5 diff --git a/README.md b/README.md index 449dd29..efd2340 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,6 @@ Here is the list of currently supported Municipalities - Fredensborg - Frederiksberg - Frederikssund - - Furesø - Gentofte - Gladsaxe - Glostrup @@ -147,6 +146,7 @@ Here is the list of currently supported Municipalities - Jammerbugt - Kerteminde - Køge + - Lejre - Lyngby-Taarbæk - Mariagerfjord - Næstved diff --git a/custom_components/affalddk/calendar.py b/custom_components/affalddk/calendar.py index 212896d..7ca4abc 100644 --- a/custom_components/affalddk/calendar.py +++ b/custom_components/affalddk/calendar.py @@ -120,6 +120,11 @@ async def async_get_events(self, hass: HomeAssistant, start_date: datetime.datet _start: datetime.date = _pickup_events.date _end: datetime.date = _start + timedelta(days=1) + if start_date.date() > _start: + continue + if end_date.date() < _end: + continue + if _start and _end: events.append( CalendarEvent( diff --git a/custom_components/affalddk/manifest.json b/custom_components/affalddk/manifest.json index 3d8c64a..37e5b22 100644 --- a/custom_components/affalddk/manifest.json +++ b/custom_components/affalddk/manifest.json @@ -12,7 +12,7 @@ "iot_class": "cloud_polling", "issue_tracker": "https://github.com/briis/affalddk/issues", "requirements": [ - "pyrenoweb==2.0.15" + "pyrenoweb==2.0.17" ], - "version": "2.0.6" + "version": "2.0.7" } \ No newline at end of file diff --git a/custom_components/affalddk/sensor.py b/custom_components/affalddk/sensor.py index d35d866..d02bacf 100644 --- a/custom_components/affalddk/sensor.py +++ b/custom_components/affalddk/sensor.py @@ -130,6 +130,11 @@ class AffaldDKSensorEntityDescription(SensorEntityDescription): name="Pap", native_unit_of_measurement="dage", ), + AffaldDKSensorEntityDescription( + key="plast", + name="Plast", + native_unit_of_measurement="dage", + ), AffaldDKSensorEntityDescription( key="plastmetal", name="Plast & Metal", @@ -252,7 +257,7 @@ def native_unit_of_measurement(self) -> str | None: pickup_time: datetime.date = self._pickup_events.date _pickup_days = (pickup_time - current_time).days if pickup_time: - if _pickup_days + 1 == 1: + if _pickup_days == 1: return "dag" return super().native_unit_of_measurement @@ -266,7 +271,7 @@ def native_value(self) -> StateType: pickup_time: datetime.date = self._pickup_events.date _pickup_days = (pickup_time - current_time).days if pickup_time: - return _pickup_days + 1 + return _pickup_days @property def icon(self) -> str | None: @@ -282,7 +287,7 @@ def extra_state_attributes(self) -> None: _timestamp = dt.today() _current_date = dt.today() _current_date = _current_date.date() - _state = (_date - _current_date).days + 1 + _state = (_date - _current_date).days if _state < 0: _state = 0 _day_number = _date.weekday() diff --git a/hacs.json b/hacs.json index 2728bf6..d1c0296 100644 --- a/hacs.json +++ b/hacs.json @@ -2,7 +2,7 @@ "name": "Affaldshåndtering DK", "content_in_root": false, "render_readme": true, - "homeassistant": "2023.6.0", + "homeassistant": "2024.2.0", "country": [ "DK" ] diff --git a/images/affalddk/plast.svg b/images/affalddk/plast.svg new file mode 100644 index 0000000..4e21447 --- /dev/null +++ b/images/affalddk/plast.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index d328e67..7132089 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ colorlog==6.8.2 -homeassistant==2024.3.1 +homeassistant==2024.3.3 pip>=23.2.1,<24.1 ruff==0.3.4