Send an ON message to device group.
1702
def on(self):
        """"""
        on_command = ExtendedSend(self._address,
                                  COMMAND_LIGHT_ON_0X11_NONE,
                                  self._udata,
                                  cmd2=0xff)
        on_command.set_checksum()
        self._send_method(on_command, self._on_message_received)
125432
@Override
	public void on(String name, Tree payload, Groups groups, boolean broadcast) throws Exception {
		FastBuildTree msg = new FastBuildTree(6);
		msg.putUnsafe("ver", ServiceBroker.PROTOCOL_VERSION);
		msg.putUnsafe("sender", currentNodeID);
		msg.putUnsafe("event", name);
		msg.putUnsafe("broadcast", broadcast);
		if (groups != null) {
			String[] array = groups.groups();
			if (array != null && array.length > 0) {
				msg.putUnsafe("groups", array);
			}
		}
		if (payload != null) {
			msg.putUnsafe("data", payload);
		}
		transporter.publish(PACKET_EVENT, nodeID, msg);
	}
1317120
def on_message(self, client, userdata, msg):
        '''
        
        '''
        if msg.topic == 'serial_device/refresh_comports':
            self.refresh_comports()
            return

        match = CRE_MANAGER.match(msg.topic)
        if match is None:
            logger.debug('Topic NOT matched: `%s`', msg.topic)
        else:
            logger.debug('Topic matched: `%s`', msg.topic)
            # Message topic matches command.  Handle request.
            command = match.group('command')
            port = match.group('port')

            #     serial_device/<port>/send   # Bytes to send
            if command == 'send':
                self._serial_send(port, msg.payload)
            elif command == 'connect':
                # serial_device/<port>/connect  # Request connection
                try:
                    request = json.loads(msg.payload)
                except ValueError as exception:
                    logger.error('Error decoding "%s (%s)" request: %s',
                                 command, port, exception)
                    return
                self._serial_connect(port, request)
            elif command == 'close':
                self._serial_close(port)
189829
def on(self):
        """"""
        on_command = StandardSend(self._address,
                                  COMMAND_LIGHT_ON_0X11_NONE, 0xff)
        self._send_method(on_command,
                          self._on_message_received)
651285
def push_single_device(device_token, message_type, message, params = {})
      params.merge!({
        device_token: device_token,
        message:      message,
        message_type: message_type
        })
      self.send_request('push','single_device',params)
    end
575152
def _message(self, beacon_config, invert_hello=False):
		
		m = WBeaconGouverneurMessenger._message(self, beacon_config, invert_hello=invert_hello)
		hostgroups = self._message_hostgroup_generate()
		if len(hostgroups) > 0:
			m += (WHostgroupBeaconMessenger.__message_groups_splitter__ + hostgroups)
		return m
1078641
private void doGroupStart(final JsonObject message) {
    String groupID = message.getString("group");
    String name = message.getString("name");
    String parentId = message.getString("parent");
    Object args = deserializer.deserialize(message);
    DefaultConnectionInputGroup group = new DefaultConnectionInputGroup(groupID, name, this);
    groups.put(groupID, group);
    if (parentId != null) {
      if (log.isDebugEnabled()) {
        log.debug(String.format("%s - Group started: Group[name=%s, group=%s, parent=%s, args=%s]", this, name, groupID, parentId, args));
      }
      if (currentBatch != null && parentId.equals(currentBatch.id())) {
        currentBatch.handleGroup(group);
      } else {
        DefaultConnectionInputGroup parent = groups.get(parentId);
        if (parent != null) {
          parent.handleGroup(group);
        }
      }
    } else {
      if (log.isDebugEnabled()) {
        log.debug(String.format("%s - Group started: Group[name=%s, group=%s, args=%s]", this, name, groupID, args));
      }
      // First check for a named group handler. If a named group handler isn't
      // registered then trigger the arbitrary group handler if one is registered.
      Handler<InputGroup> handler = groupHandlers.get(name);
      if (handler != null) {
        handler.handle(group);
      } else if (groupHandler != null) {
        groupHandler.handle(group);
      } else {
        groupReady(groupID);
      }
    }
    group.handleStart(args);
  }
1089462
def emit(self, *args, **kwargs):
        '''
        
        '''
        self._messanger.send(self, *args, **kwargs)
91990
private void sendInternal(long destHSId, VoltMessage message)
    {
        message.m_sourceHSId = getHSId();
        m_messenger.send(destHSId, message);
    }
138234
private void doSelectGroup(final Message<JsonObject> message) {
    final Object key = message.body().getValue("key");
    if (key == null) {
      message.reply(new JsonObject().putString("status", "error").putString("message", "No key specified."));
    } else {
      selectGroup(key, new Handler<AsyncResult<String>>() {
        @Override
        public void handle(AsyncResult<String> result) {
          if (result.failed()) {
            message.reply(new JsonObject().putString("status", "error").putString("message", result.cause().getMessage()));
          } else if (result.result() == null) {
            message.reply(new JsonObject().putString("status", "error").putString("message", "No groups to select."));
          } else {
            message.reply(new JsonObject().putString("status", "ok").putString("result", result.result()));
          }
        }
      });
    }
  }
610445
def _sync_to_group(self, device):
        '''
        '''

        config_sync_cmd = 'config-sync to-group %s' % self.name
        device.tm.cm.exec_cmd('run', utilCmdArgs=config_sync_cmd)
252833
def enableGroup(self):
        """"""
        radioButtonListInGroup = PygWidgetsRadioButton.__PygWidgets__Radio__Buttons__Groups__Dicts__[self.group]
        for radioButton in radioButtonListInGroup:
            radioButton.enable()
34211
def receive_message(self, msg):
        """"""
        _LOGGER.debug('Starting X10Device.receive_message')
        if hasattr(msg, 'isack') and msg.isack:
            _LOGGER.debug('Got Message ACK')
            if self._send_msg_lock.locked():
                self._send_msg_lock.release()
        callbacks = self._message_callbacks.get_callbacks_from_message(msg)
        _LOGGER.debug('Found %d callbacks for msg %s', len(callbacks), msg)
        for callback in callbacks:
            _LOGGER.debug('Scheduling msg callback: %s', callback)
            self._plm.loop.call_soon(callback, msg)
        self._last_communication_received = datetime.datetime.now()
        _LOGGER.debug('Ending Device.receive_message')
963225
def notify(title, message, key, event=None, retcode=None):
    

    data = {
        'title': title if len(title) <= 20 else title[:19] + u'\u2026',
        'msg': message,
        'key': key
    }

    if event:
        data['event'] = event

    headers = {'User-Agent': USER_AGENT}

    endpoint = "https://api.simplepush.io"

    resp = requests.post(endpoint + '/send', data=data, headers=headers)

    resp.raise_for_status()
852642
def send_group_text(self, sender, receiver, content):
        
        return self.send_text(sender, 'group', receiver, content)
1220354
def notify(condition, message)
      spec = Contact.normalize(condition.notify)
      unmatched = []

      # Resolve contacts.
      resolved_contacts =
      spec[:contacts].inject([]) do |acc, contact_name_or_group|
        cons = Array(God.contacts[contact_name_or_group] || God.contact_groups[contact_name_or_group])
        unmatched << contact_name_or_group if cons.empty?
        acc += cons
        acc
      end

      # Warn about unmatched contacts.
      unless unmatched.empty?
        msg = "#{condition.watch.name} no matching contacts for '#{unmatched.join(", ")}'"
        applog(condition.watch, :warn, msg)
      end

      # Notify each contact.
      resolved_contacts.each do |c|
        host = `hostname`.chomp rescue 'none'
        begin
          c.notify(message, Time.now, spec[:priority], spec[:category], host)
          msg = "#{condition.watch.name} #{c.info ? c.info : "notification sent for contact: #{c.name}"} (#{c.base_name})"
          applog(condition.watch, :info, msg % [])
        rescue Exception => e
          applog(condition.watch, :error, "#{e.message} #{e.backtrace}")
          msg = "#{condition.watch.name} Failed to deliver notification for contact: #{c.name} (#{c.base_name})"
          applog(condition.watch, :error, msg % [])
        end
      end
    end
272239
def notify_peer_message(self, message, sender_id):
        """"""
        payload = message.SerializeToString()
        self._notify(
            "consensus_notifier_notify_peer_message",
            payload,
            len(payload),
            sender_id,
            len(sender_id))