hass-core/homeassistant/components/tesla_fleet/const.py
Brett Adams 6ecc5c19a2
Add climate platform to Tesla Fleet (#123169)
* Add climate

* docstring

* Add tests

* Fix limited scope situation

* Add another test

* Add icons

* Type vehicle data

* Replace inline temperatures

* Fix handle_vehicle_command type

* Fix preset turning HVAC off

* Fix cop_mode check

* Use constants

* Reference docs in command signing error

* Move to a read-only check

* Remove raise_for

* Fixes

* Tests

* Remove raise_for_signing

* Remove unused strings

* Fix async_set_temperature

* Correct tests

* Remove HVAC modes at startup in read-only mode

* Fix order of init actions to set hvac_modes correctly

* Fix no temp test

* Add handle command type

* Docstrings

* fix matches and fix a bug

* Split tests

* Fix issues from rebase
2024-09-03 14:38:47 +02:00

50 lines
1,014 B
Python

"""Constants used by Tesla Fleet integration."""
from __future__ import annotations
from enum import StrEnum
import logging
from tesla_fleet_api.const import Scope
DOMAIN = "tesla_fleet"
CONF_REFRESH_TOKEN = "refresh_token"
LOGGER = logging.getLogger(__package__)
CLIENT_ID = "71b813eb-4a2e-483a-b831-4dec5cb9bf0d"
AUTHORIZE_URL = "https://auth.tesla.com/oauth2/v3/authorize"
TOKEN_URL = "https://auth.tesla.com/oauth2/v3/token"
SCOPES = [
Scope.OPENID,
Scope.OFFLINE_ACCESS,
Scope.VEHICLE_DEVICE_DATA,
Scope.VEHICLE_CMDS,
Scope.VEHICLE_CHARGING_CMDS,
Scope.ENERGY_DEVICE_DATA,
Scope.ENERGY_CMDS,
]
MODELS = {
"S": "Model S",
"3": "Model 3",
"X": "Model X",
"Y": "Model Y",
}
class TeslaFleetState(StrEnum):
"""Teslemetry Vehicle States."""
ONLINE = "online"
ASLEEP = "asleep"
OFFLINE = "offline"
class TeslaFleetClimateSide(StrEnum):
"""Tesla Fleet Climate Keeper Modes."""
DRIVER = "driver_temp"
PASSENGER = "passenger_temp"