Skip to content

Commit

Permalink
Update to comments & code styling
Browse files Browse the repository at this point in the history
  • Loading branch information
augustas2 committed Feb 14, 2022
1 parent c485265 commit 2f9d50b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
10 changes: 5 additions & 5 deletions custom_components/eldes_alarm/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@

API_PATHS = {
"AUTH": "auth/",
"DEVICE": "device/"
"DEVICE": "device/",
}

ALARM_MODES = {
"DISARM": "disarm",
"ARM_AWAY": "arm",
"ARM_HOME": "armstay"
"ARM_HOME": "armstay",
}

OUTPUT_TYPES = {
"SWITCH": "SWITCH"
"SWITCH": "SWITCH",
}

OUTPUT_ICONS_MAP = {
Expand All @@ -39,10 +39,10 @@
1: 30,
2: 60,
3: 80,
4: 100
4: 100,
}

BATTERY_STATUS_MAP = {
True: "OK",
False: "Bad"
False: "Bad",
}
7 changes: 4 additions & 3 deletions custom_components/eldes_alarm/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,11 @@ def unique_id(self):
@property
def name(self):
"""Return the name of the sensor."""
return f"{self.__get_temp()['sensorName']} temperature"
return f"{self.__get_temp()['sensorName']} Temperature"

@property
def device_class(self):
"""Return the device class."""
return DEVICE_CLASS_TEMPERATURE

@property
Expand All @@ -139,9 +140,9 @@ def native_unit_of_measurement(self):

@property
def native_value(self):
"""Return the state of the sensor."""
"""Return the value of the sensor."""
return self.__get_temp().get("temperature", 0.0)

def __get_temp(self):
"""Return temp of entity."""
"""Return sensor data."""
return self.data["temp"][self.entity_index]

0 comments on commit 2f9d50b

Please sign in to comment.