docs: def parse_motion_state(val):
          """Convert motion state byte to seconds."""
          number = val & 0b00111111
          unit = (val & 0b11000000) >> 6
          if unit == 1:
              number *= 60 # minutes
          elif unit == 2:
              number *= 60 * 60 # hours
          elif unit == 3 and number < 32:
              number *= 60 * 60 * 24 # days
          elif unit == 3:
              number -= 32
              number *= 60 * 60 * 24 * 7 # weeks
          return number