Skip to content

Commit

Permalink
Fix string literal error
Browse files Browse the repository at this point in the history
  • Loading branch information
itchannel committed Jan 26, 2023
1 parent 823ecfe commit f31af10
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/fordpass/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def get_value(self, ftype):
decimal = 0
tirepress = {}
for key, value in self.coordinator.data["TPMS"].items():
if "TirePressure" in key and value is not None and value is not '':
if "TirePressure" in key and value is not None and value != '':
if "recommended" in key:
tirepress[key] = round(float(value["value"]) * rval, decimal)
else:
Expand Down Expand Up @@ -442,9 +442,9 @@ def icon(self):
@property
def state_class(self):
if "state_class" in SENSORS[self.sensor]:
if SENSORS[self.sensor]["state_class"] is "total":
if SENSORS[self.sensor]["state_class"] == "total":
return SensorStateClass.TOTAL
elif SENSORS[self.sensor]["state_class"] is "measurement":
elif SENSORS[self.sensor]["state_class"] == "measurement":
return SensorStateClass.MEASUREMENT
else:
return None
Expand All @@ -454,7 +454,7 @@ def state_class(self):
@property
def device_class(self):
if "device_class" in SENSORS[self.sensor]:
if SENSORS[self.sensor]["device_class"] is "distance":
if SENSORS[self.sensor]["device_class"] == "distance":
return SensorDeviceClass.DISTANCE
else:
return None

0 comments on commit f31af10

Please sign in to comment.