File: __init__.py

package info (click to toggle)
python-idasen-ha 2.6.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 188 kB
  • sloc: python: 571; sh: 5; makefile: 4
file content (13 lines) | stat: -rw-r--r-- 387 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
"""Tests for idasen_ha."""

from bleak.backends.device import BLEDevice
from idasen import IdasenDesk

FAKE_BLE_DEVICE = BLEDevice("AA:BB:CC:DD:EE:FF", None, {"path": ""})


def height_percent_to_meters(percent: float):
    """Convert height from percentage to meters."""
    return IdasenDesk.MIN_HEIGHT + (IdasenDesk.MAX_HEIGHT - IdasenDesk.MIN_HEIGHT) * (
        percent / 100
    )