a4214afddbc10730c4fcbd33815a1b533b3ca359,homeassistant/components/sensor/volvooncall.py,VolvoSensor,state,#VolvoSensor#,26
Before Change
Return the state of the sensor.
val = getattr(self.vehicle, self._attribute)
if self._attribute == "odometer":
return round(val / 1000) // km
return val
@property
After Change
return val
if self._attribute == "odometer":
val /= 1000 // m -> km
if "mil" in self.unit_of_measurement:
val /= 10 // km -> mil
if self._attribute == "average_fuel_consumption":
val /= 10 // L/1000km -> L/100km
if "mil" in self.unit_of_measurement:
return round(val, 2)
else:
return round(val, 1)
elif self._attribute == "distance_to_empty":
return int(floor(val))
else:
return int(round(val))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances Project Name: home-assistant/home-assistant
Commit Name: a4214afddbc10730c4fcbd33815a1b533b3ca359
Time: 2017-12-10
Author: molobrakos@users.noreply.github.com
File Name: homeassistant/components/sensor/volvooncall.py
Class Name: VolvoSensor
Method Name: state
Project Name: brian-team/brian2
Commit Name: a21b67aed967b3932019c8b0d266bf4098a55d2a
Time: 2017-07-06
Author: charleetje@gmail.com
File Name: brian2/codegen/generators/GSL_generator.py
Class Name: GSLCythonCodeGenerator
Method Name: write_dataholder
Project Name: brian-team/brian2
Commit Name: 25ca9c249fd3e11bb166b42ffeb2433036964bd1
Time: 2017-07-05
Author: charleetje@gmail.com
File Name: brian2/codegen/generators/GSL_generator.py
Class Name: GSLWeaveCodeGenerator
Method Name: write_dataholder