def _query_state(self):
        if not self._command_state:
            _LOGGER.error('No state command specified')
            return
        if self._value_template:
            return CommandSwitch._query_state_value(self._command_state)
        return CommandSwitch._query_state_code(self._command_state)
Query for state.
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/switch/command_line.py/CommandSwitch._query_state