Skip to content

Commit

Permalink
refactor: rename online sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse committed Jan 24, 2020
1 parent 9bd66b9 commit 97a40ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions teslajsonpy/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ def has_battery():
return False


class Online(VehicleDevice):
"""Home-Assistant Online class for a Tesla VehicleDevice."""
class OnlineSensor(VehicleDevice):
"""Home-Assistant Online sensor class for a Tesla VehicleDevice."""

def __init__(self, data: Dict, controller) -> None:
"""Initialize the Online sensor.
Expand Down
8 changes: 6 additions & 2 deletions teslajsonpy/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
from typing import Optional, Text, Tuple

from teslajsonpy.battery_sensor import Battery, Range
from teslajsonpy.binary_sensor import ChargerConnectionSensor, Online, ParkingSensor
from teslajsonpy.binary_sensor import (
ChargerConnectionSensor,
OnlineSensor,
ParkingSensor,
)
from teslajsonpy.charger import ChargerSwitch, ChargingSensor, RangeSwitch
from teslajsonpy.climate import Climate, TempSensor
from teslajsonpy.connection import Connection
Expand Down Expand Up @@ -108,7 +112,7 @@ async def connect(self, test_login=False) -> Tuple[Text, Text]:
self.__components.append(ParkingSensor(car, self))
self.__components.append(GPS(car, self))
self.__components.append(Odometer(car, self))
self.__components.append(Online(car, self))
self.__components.append(OnlineSensor(car, self))

tasks = [self.update(car["id"], wake_if_asleep=True) for car in cars]
try:
Expand Down

0 comments on commit 97a40ff

Please sign in to comment.