The state of the thermostat programming

        :return: A thermostat state object of the current setting
14056
def thermostat_state(self):
        
        current_state = self.thermostat_info.active_state
        state = self.get_thermostat_state_by_id(current_state)
        if not state:
            self._logger.debug('Manually set temperature, no Thermostat '
                               'State chosen!')
        return state
1251334
def get_target_state():
    
    sdp_state = SDPState()
    errval, errdict = _check_status(sdp_state)
    if errval == "error":
        LOG.debug(errdict['reason'])
        return dict(
            current_target_state="unknown",
            last_updated="unknown",
            reason=errdict['reason']
        )
    LOG.debug('Getting target state')
    target_state = sdp_state.target_state
    LOG.debug('Target state = %s', target_state)
    return dict(
        current_target_state=target_state,
        allowed_target_states=sdp_state.allowed_target_states[
            sdp_state.current_state],
        last_updated=sdp_state.target_timestamp.isoformat())
185373
def set_state(self, state):
        
        values = {"desired_state": {"locked": state}}
        response = self.api_interface.local_set_state(self, values)
        self._update_state_from_response(response)
437127
def thermostat_state(self, name):
        
        self._validate_thermostat_state_name(name)
        id_ = next((key for key in STATES.keys()
                    if STATES[key].lower() == name.lower()), None)
        data = copy.copy(self._parameters)
        data.update({'state': 2,
                     'temperatureState': id_})
        response = self._get_data('/client/auth/schemeState', data)
        self._logger.debug('Response received {}'.format(response))
        self._clear_cache()
1297390
def set_temperature(self, max_set_point=None):
        
        desired_state = {}

        if max_set_point:
            desired_state['max_set_point'] = max_set_point

        response = self.api_interface.set_device_state(self, {
            "desired_state": desired_state
        })

        self._update_state_from_response(response)
1240608
def _check_state(self):
        
        if(self.grid is not None and
           self.configs.configs is not None and
           self.assignments['forward_model'] is not None):
            self.can_model = True

        if(self.grid is not None and
           self.assignments['measurements'] is not None):
            self.can_invert = True
748319
def set_current_state(self):
        """""""
        if not self.thresholds:
            self.thresholds = self.parent.get_existing_keyword('thresholds')
        if not self.value_maps:
            self.value_maps = self.parent.get_existing_keyword('value_maps')
93947
def get_state(self):
        
        state = dict(sampler={}, stochastics={})
        # The state of the sampler itself.
        for s in self._state:
            state['sampler'][s] = getattr(self, s)

        # The state of each stochastic parameter
        for s in self.stochastics:
            state['stochastics'][s.__name__] = s.value
        return state
133844
def thermostat_info(self):
        """"""
        info = self._state['thermostatInfo']
        return ThermostatInfo(info.get('activeState'),
                              info.get('boilerModuleConnected'),
                              info.get('burnerInfo'),
                              info.get('currentDisplayTemp'),
                              info.get('currentModulationLevel'),
                              info.get('currentSetpoint'),
                              info.get('currentTemp'),
                              info.get('errorFound'),
                              info.get('haveOTBoiler'),
                              info.get('nextProgram'),
                              info.get('nextSetpoint'),
                              info.get('nextState'),
                              info.get('nextTime'),
                              info.get('otCommError'),
                              info.get('programState'),
                              info.get('randomConfigId'),
                              info.get('realSetpoint'))
576767
def current_state(self):
        
        field_names = set()
        [field_names.add(f.name) for f in self._meta.local_fields]
        [field_names.add(f.attname) for f in self._meta.local_fields]
        return dict([(field_name, getattr(self, field_name)) for field_name in field_names])
931377
def dump_state(self):
        

        superstate = super(ReferenceController, self).dump_state()

        superstate.update({
            'state_name': self.STATE_NAME,
            'state_version': self.STATE_VERSION,
            'app_info': self.app_info,
            'os_info': self.os_info,

            # Dump all of the subsystems
            'remote_bridge': self.remote_bridge.dump(),
            'tile_manager': self.tile_manager.dump(),
            'config_database': self.config_database.dump(),
            'sensor_log': self.sensor_log.dump()
        })

        return superstate
514557
def get_zone_temperature(self, zone_name):
        
        zone = self.get_zone(zone_name)

        if zone is None:
            raise RuntimeError("Unknown zone")

        return zone['currentTemperature']
146587
def state(ctx):
    
    dev = ctx.obj
    click.echo(dev)
    ctx.forward(locked)
    ctx.forward(low_battery)
    ctx.forward(window_open)
    ctx.forward(boost)
    ctx.forward(temp)
    # ctx.forward(presets)
    ctx.forward(mode)
    ctx.forward(valve_state)
843222
def get_current_state():
    """"""
    sdp_state = SDPState()
    errval, errdict = _check_status(sdp_state)
    if errval == "error":
        LOG.debug(errdict['reason'])
        return dict(
            current_state="unknown",
            last_updated="unknown",
            reason=errdict['reason']
        )
    LOG.debug('Current State: %s', sdp_state.current_state)
    LOG.debug('Current State last updated: %s',
              sdp_state.current_timestamp.isoformat())
    return dict(
        current_state=sdp_state.current_state,
        last_updated=sdp_state.current_timestamp.isoformat()
    ), HTTPStatus.OK
55785
def call_cool(tstat):
    
    current_hsp, current_csp = tstat.heating_setpoint, tstat.cooling_setpoint
    current_temp = tstat.temperature
    tstat.write({
        'heating_setpoint': current_temp-20,
        'cooling_setpoint': current_temp-10,
        'mode': COOL,
    })

    def restore():
        tstat.write({
            'heating_setpoint': current_hsp,
            'cooling_setpoint': current_csp,
            'mode': AUTO,
        })
    return restore
512021
def _process_state(self):
        
        self._log.debug("Capturing state from the request")
        response = self._session.get(url=self.ALERTS_URL, headers=self.HEADERS)
        soup = BeautifulSoup(response.content, "html.parser")
        for i in soup.findAll('script'):
            if i.text.find('window.STATE') == -1:
                continue
            state = json.loads(i.text[15:-1])
            if state != "":
                self._state = state
                self._log.debug("State value set: %s" % self._state)
        return self._state
902178
def get_target_temp(self):
        
        if not self._connected:
            return
        temp_ovrd = self._protocol.status.get(DATA_ROOM_SETPOINT_OVRD)
        if temp_ovrd:
            return temp_ovrd
        return self._protocol.status.get(DATA_ROOM_SETPOINT)