File: version.py

package info (click to toggle)
aioairzone 1.0.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 664 kB
  • sloc: python: 3,328; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 635 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""Airzone Local API Version."""

from typing import Any

from aiohttp.web_response import Response
from helpers import api_json_response

from aioairzone.const import API_VERSION


class AirzoneVersion:
    """Airzone Local API Version."""

    def __init__(self, version: str) -> None:
        """Local API Version init."""
        self.version: str = version

    def data(self) -> dict[str, Any]:
        """Return Local API Version data."""
        return {
            API_VERSION: self.version,
        }

    async def post(self) -> Response:
        """POST Local API version."""
        return api_json_response(self.data())