Skip to content

Commit

Permalink
fixed typo in variable
Browse files Browse the repository at this point in the history
  • Loading branch information
aschwith committed Jun 26, 2018
1 parent b4beccf commit 9564416
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions enocean/eep_parser.py
Expand Up @@ -164,7 +164,7 @@ def _parse_eep_A5_11_04(self, payload, status):
return results

def _parse_eep_A5_12_01(self, payload, status):
# Status command from switche actor with powermeter, for example eltako FSVA-230
# Status command from switch actor with powermeter, for example Eltako FSVA-230
results = {}
status = payload[3]
is_data = (status & 0x08) == 0x08
Expand All @@ -173,18 +173,18 @@ def _parse_eep_A5_12_01(self, payload, status):
return results
is_power = (status & 0x04) == 0x04
div_enum = (status & 0x03)
divisor = 1
divisor = 1.0
if(div_enum == 0):
divisor = 1
divisor = 1.0
self.logger.debug("enocean: processing A5_12_01: divisor is {0}".format(divisor))
elif(div_enum == 1):
divisor = 10
divisor = 10.0
self.logger.debug("enocean: processing A5_12_01: divisor is {0}".format(divisor))
elif(div_enum == 2):
divisor = 100
divisor = 100.0
self.logger.debug("enocean: processing A5_12_01: divisor is {0}".format(divisor))
elif(div_enum == 3):
divisor = 1000
divisor = 1000.0
self.logger.debug("enocean: processing A5_12_01: divisor is {0}".format(divisor))
else:
self.logger.warning("enocean: processing A5_12_01: Unknown enum ({0}) for divisor".format(div_enum))
Expand All @@ -194,8 +194,9 @@ def _parse_eep_A5_12_01(self, payload, status):
else:
self.logger.debug("enocean: processing A5_12_01: powermeter: Unit is kWh")
value = (payload[0] << 16) + (payload[1] << 8) + payload[2]
self.logger.debug("enocean: processing A5_12_01: powermeter: {0}W".format(value))
results['VALUE'] = value/devisor
value = value / divisor
self.logger.debug("enocean: processing A5_12_01: powermeter: {0} W".format(value))
results['VALUE'] = value
return results

def _parse_eep_A5_20_04(self, payload, status):
Expand Down

0 comments on commit 9564416

Please sign in to comment.