Skip to content

Commit

Permalink
Added a function to get name of meter model by model ID.
Browse files Browse the repository at this point in the history
  • Loading branch information
vzagorovskiy committed Mar 4, 2023
1 parent 0cb2fca commit 3c3bf72
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.1.1] - 2023-03-04

### Added

- Get meter model name by model id.


## [2.1.0] - 2023-02-26

### Changed
Expand Down
4 changes: 2 additions & 2 deletions aiotaipit/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# file generated by setuptools_scm
# don't change, don't track in version control
__version__ = version = '2.1.0'
__version_tuple__ = version_tuple = (2, 1, 0)
__version__ = version = '2.1.1'
__version_tuple__ = version_tuple = (2, 1, 1)
6 changes: 5 additions & 1 deletion aiotaipit/helpers.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
"""Helpers and utils."""
from __future__ import annotations

from const import REGIONS, UNKNOWN
from const import REGIONS, METER_MODELS, UNKNOWN


def get_region_name(region_id: int) -> str:
region_name = REGIONS.get(region_id, f'{UNKNOWN} <{region_id}>')
return region_name


def get_model_name(model_id: int) -> str:
return METER_MODELS.get(model_id, f'{UNKNOWN} <{model_id}>')

0 comments on commit 3c3bf72

Please sign in to comment.