Skip to content

Latest commit

 

History

History
119 lines (85 loc) · 4.33 KB

CHANGELOG.md

File metadata and controls

119 lines (85 loc) · 4.33 KB

Changelog

v1.3.10 - 15.01.2024

Improved

  • files: alert_type.py, client.py

More info

  • Added AlertType.INFO: "ЗМІ повідомляють про вибухи", and AlertType.INFO: "Media reports about explosions",
  • client.py: removed: init test run(self.__make_request("GET", self._ALERTS_ENDPOINT)) and from asyncio import run

v1.3.9 - 30.12.2023

Added

  • files: python-app.yml, test.py, .env.template

More info

  • Added tests

v1.3.8 - 29.12.2023

Improved

  • files: client.py, alert_type.py
  • functions: __make_request, refactor_alert_type, alert_loop

Renamed

  • functions: _make_request 👉 __make_request

More info

  • alert_type.py: added variables: ALERT_TYPE_UA, ALERT_TYPE_EN
  • __make_request: case 404: raise Exception("The requested resource could not be found")
  • refactor_alert_type: added ua_lang, ua or english language; if ua_lang: return ALERT_TYPE_UA.get(type, "Повітряна тривога") else: return ALERT_TYPE_EN.get(type, "Air alarm")
  • alert_loop: added ua_lang, ua or english language; alert_message = "Оголошено тривогу" if ua_lang else "Air raid siren", clear_message = "Відбій тривоги" if ua_lang else "Air siren all clear"

v1.3.7 - 28.12.2023

Improved

  • files: client.py
  • functions: _make_request, alert_loop

More info

  • _make_request: match endpoint: case self._ALERT_STATUS_ENDPOINT: return types.AlertModification(**response_json) case self._REGION_HISTORY_ENDPOINT: return types.RegionAlarmsHistory(**response_json) case self._REGIONS_ENDPOINT: return types.RegionsViewModel(**response_json) case self._WEBHOOK_ENDPOINT: return types.WebHook(**response_json) case endpoint if self._ALERTS_ENDPOINT in endpoint: return [types.AlertRegionModel(**item) for item in response_json]

  • alert_loop: variables: utc renamed to tzinfo

v1.3.6 - 27.12.2023

Improved

  • files: client.py
  • functions: alert_loop

Added

  • libraries: from datetime import datetime
  • functions: refactor_alert_type

More info

  • alert_loop: utc = datetime.now().tzinfo changed_str.astimezone(utc)

v1.3.5 - 27.12.2023

Improved

  • files: poetry.lock, client.py
  • functions: _make_request

Added

  • libraries: from asyncio import sleep as async_sleep, from aiohttp.client_exceptions import ClientConnectorError
  • functions: alert_loop

More info

  • _make_request: match response.status: case 200: pass case 401: raise PermissionError("Invalid API token") case 503: raise Exception("API is currently unavailable") case unknown_status: raise Exception(f"Request failed with status code {unknown_status}\n{await response.text()}")

v1.3.4 - 04.12.2023

Improved

  • functions: init, _make_request
  • files: client.py

Added

  • libraries: from asyncio import run

More info

  • init: added run(self._make_request("GET", self._ALERTS_ENDPOINT))
  • _make_request: if response.status != 200: raise Exception("Invalid API token")

v1.3.3 - 29.11.2023

Improved

  • code: Code format

Added

  • variables: Links have been moved to constants

Removed

  • functions: get_region_alerts

More info

  • removed function get_region_alerts, functionality has been moved to get_alerts