mirror of
https://github.com/weewx/weewx.git
synced 2026-04-29 13:52:48 -04:00
return 0 or 1 for battery status rather than 0,1,2,4,8
This commit is contained in:
@@ -867,7 +867,7 @@ import weewx.abstractstation
|
||||
import weewx.units
|
||||
import weewx.wxformulas
|
||||
|
||||
DRIVER_VERSION = '0.26'
|
||||
DRIVER_VERSION = '0.27'
|
||||
|
||||
# flags for enabling/disabling debug verbosity
|
||||
DEBUG_WRITES = 0
|
||||
@@ -1420,9 +1420,10 @@ def getFrequencyStandard(frequency):
|
||||
batterybits = { 'wind':0, 'rain':1, 'th':2, 'console':3 }
|
||||
|
||||
def getBatteryStatus(status, flag):
|
||||
'''Return 1 if bit is set, 0 otherwise'''
|
||||
bit = batterybits.get(flag)
|
||||
if bit is not None:
|
||||
return BitHandling.testBit(status, bit)
|
||||
return 1 if BitHandling.testBit(status, bit) else 0
|
||||
return None
|
||||
|
||||
class CWeatherTraits(object):
|
||||
|
||||
@@ -25,6 +25,8 @@ Fix imagegenerator aggregation to permit data tables with no 'interval' column.
|
||||
|
||||
Prompt for metric/US units for debian installations.
|
||||
|
||||
For WS28xx stations, return 0 for battery ok and 1 for battery failure.
|
||||
|
||||
|
||||
2.6.3 04/10/14
|
||||
|
||||
|
||||
Reference in New Issue
Block a user