Sets the state property
546360
public function setLight( $input )
    {
        $data = json_encode( $input );
        $this->parent->pest()->put( "lights/" . $this->id . "/state", $data );

        $this->parent->update( $this->id );
    }
6909
def setProperty(self, prop: str, value: str, priority: str = None
                    ) -> None:
        
        self[prop] = value
283942
protected function _setState($state)
    {
        if ($state !== null && !is_string($state) && !($state instanceof Stringable)) {
            throw $this->_createInvalidArgumentException(
                $this->__('Argument is not a valid state'),
                null,
                null,
                $state
            );
        }

        $this->state = $state;
    }
1209035
def set_state(self, value, labels=None):
        

        values = {"value": value}
        json_labels = []
        if labels:
            for label in labels:
                json_labels.append(str(label).upper())
            values["labels"] = json_labels

        self._update_state_from_response(self.parent.set_dial(values, self.index()))
658965
function init() {
    var stateFromHash = getStateFromHash();
    var stateChanged = false;

    if (typeof defaults === 'object' && defaults) {
      Object.keys(defaults).forEach(function(key) {
        if (key in stateFromHash) return;

        stateFromHash[key] = defaults[key]
        stateChanged = true;
      });
    }

    if (stateChanged) set(stateFromHash);
  }
699089
private function setStates()
    {
        $appID = App::getCurrentID();
        $complementID = self::getCurrentID();

        if (! is_null($this->states)) {
            $states = $this->getStatesFromFile();

            if ($this->stateChanged($states)) {
                $file = $this->getStatesFilePath();
                $states[$appID][$complementID] = $this->states;
                Json::arrayToFile($states, $file);
                Hook::doAction('Eliasis/Complement/after_set_states', $states);
            }
        }
    }
356432
function setState($state) {
		if($state == (self::WINDOW_DOOR_SENSOR_STATE_OPEN or self::WINDOW_DOOR_SENSOR_STATE_CLOSED))
			$this->state = $state;
		else
			throw new \Exception('Invalid WindowDoorSensor state "'.$state.'"');
	}
616757
public Object set(int index, Object obj, State state) {
		stateList.set(index, Type.from(state));
		return super.set(index, obj);
	}
554439
private void setState(final EvaluatorState toState) {
    while (true) {

      final EvaluatorState fromState = this.state.get();
      if (fromState == toState) {
        break;
      }

      if (!fromState.isLegalTransition(toState)) {
        LOG.log(Level.WARNING, "Illegal state transition: {0} -> {1}", new Object[] {fromState, toState});
        throw new IllegalStateException("Illegal state transition: " + fromState + " -> " + toState);
      }

      if (this.state.compareAndSet(fromState, toState)) {
        break;
      }
    }
  }
1313004
public function setState($state)
	{
		if ( $state == $this->getState() ) { return; }

		$this->_values['state'] = (string) $state;
		$this->setModified();
	}
571878
def set_state(self, state):
        
        if self.index() == 0:
            values = {"outlets": [{"desired_state": {"powered": state}}, {}]}
        else:
            values = {"outlets": [{}, {"desired_state": {"powered": state}}]}

        response = self.api_interface.set_device_state(self, values, id_override=self.parent_id(),
                                                       type_override="powerstrip")
        self._update_state_from_response(response)
1317801
private synchronized void setState(int state) {
        mState = state;

        // Give the new state to the Handler so the UI Activity can update
        mHandler.obtainMessage(ISOBlueDemo.MESSAGE_STATE_CHANGE, state, -1)
                .sendToTarget();
    }
341561
def _property_set(self, msg):
        """"""
        prop = self._sent_property.get('prop')
        if prop and hasattr(self, prop):
            setattr(self, prop, self._sent_property.get('val'))
        self._sent_property = {}
202800
function( key ){
		var fields = this.state.fields;
		if( fields[ key ] && fields[ key ].settings.focus === true ){
			fields = assign({}, fields);
			fields[key].settings.focus = false;
			this.setState( {fields: fields} );
		}
	}
864993
public void setState(String state)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "setState", state);

    this.state = state;

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "setState");
  }
1009632
def _set_property(self, val, *args):
        """"""
        if self._prop_write:
            val = self._prop_write(val)
        return self._setter(Adapter._get_property(self), val, *args)
1009898
function set(property, value, defaultValue) {
    if (value === undefined) {
      if (defaultValue === undefined) {
        defaultValue = this.keys[property];
      }
      if (typeof defaultValue === 'function') {
        this[property] = defaultValue.call(this);
      } else {
        this[property] = defaultValue;
      }
    } else {
      this[property] = value;
    }
  }