def METHOD_NAME(self):
    """Get sensor info and write flags."""
    response = self.values("SYST:SENSOR:IDN?")
    if response[0] == "no sensor":
        raise OSError("No sensor connected.")
    self.sensor_name = response[0]
    self.sensor_sn = response[1]
    self.sensor_cal_msg = response[2]
    self.sensor_type = response[3]
    self.sensor_subtype = response[4]
    _flags_str = response[5]
    # interpretation of the flags, see p. 49 of the manual:
    # https://www.thorlabs.de/_sd.cfm?fileName=17654-D02.pdf&partNumber=PM100D
    # Convert to binary representation and pad zeros to 9 bit for sensors
    # where not all flags are present.
    _flags_str = format(int(_flags_str), "09b")
    # Reverse the order so it matches the flag order from the manual, i.e.
    # from decimal values from 1 to 256.
    _flags_str = _flags_str[::-1]
    # Convert to boolean.
    self.flags = [x == "1" for x in _flags_str]
    # setting the flags; _dn are unused; decimal values as comments
    (
        self.is_power_sensor,  # 1
        self.is_energy_sensor,  # 2
        _d4,  # 4
        _d8,  # 8
        self.response_settable,  # 16
        self.wavelength_settable,  # 32
        self.tau_settable,  # 64
        _d128,  # 128
        self.has_temperature_sensor,  # 256
    ) = self.flags