@staticmethod
def _parse_statistic(data, scale):
    """Parse binary statistics returned from the history API"""
    i = 0
    for byte in bytearray(data):
        i = (i << 8) + byte
    if i == 32768:
        return None
    if scale == 0:
        return i
    return float(i) / (scale * 10)
