mirror of
https://github.com/symfony/recipes-contrib.git
synced 2026-03-24 00:32:17 +01:00
added ambient-link ability pack
This commit is contained in:
18
ambient-link/ability-sdk/1.0/config/packages/ability.yaml
Normal file
18
ambient-link/ability-sdk/1.0/config/packages/ability.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
services:
|
||||
AmbientLink\SDK\SmartMonkeyConnection:
|
||||
arguments: ['@amnient.link_connection_settings', '%env(AMBIENT_LINK_USERNAME)%', '%env(AMBIENT_LINK_PASSWORD)%']
|
||||
|
||||
amnient.link_connection_settings:
|
||||
class: PhpMqtt\Client\ConnectionSettings
|
||||
|
||||
PhpMqtt\Client\Contracts\MQTTClient: '@PhpMqtt\Client\MQTTClient'
|
||||
PhpMqtt\Client\MQTTClient:
|
||||
arguments:
|
||||
- '%env(AMBIENT_LINK_HOST)%'
|
||||
- '%env(AMBIENT_LINK_PORT)%'
|
||||
- '%env(AMBIENT_LINK_MONKEY_ID)%'
|
||||
|
||||
AmbientLink\SDK\Mqtt\MqttAdapter:
|
||||
arguments:
|
||||
$username: '%env(AMBIENT_LINK_USERNAME)%'
|
||||
$password: '%env(AMBIENT_LINK_PASSWORD)%'
|
||||
12
ambient-link/ability-sdk/1.0/manifest.json
Normal file
12
ambient-link/ability-sdk/1.0/manifest.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"env": {
|
||||
"AMBIENT_LINK_HOST": "",
|
||||
"AMBIENT_LINK_PORT": "1883",
|
||||
"AMBIENT_LINK_USERNAME": "",
|
||||
"AMBIENT_LINK_PASSWORD": "",
|
||||
"AMBIENT_LINK_MONKEY_ID": ""
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/"
|
||||
}
|
||||
}
|
||||
26
ambient-link/ability-sdk/1.0/post-install.txt
Normal file
26
ambient-link/ability-sdk/1.0/post-install.txt
Normal file
@@ -0,0 +1,26 @@
|
||||
<bg=blue;fg=white> </>
|
||||
<bg=blue;fg=white> To finish the install </>
|
||||
<bg=blue;fg=white> </>
|
||||
|
||||
* Your ability is almost ready:
|
||||
1. Edit <comment>src/AbilityEventSubscriber</comment> and <info>implement</info> your logic:
|
||||
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
// can be found in AmbientLink\SDK\Event\
|
||||
EnterRoomEvent::NAME => 'onEnterRoom',
|
||||
];
|
||||
}
|
||||
|
||||
public function onEnterRoom(EnterRoomEvent $event): void
|
||||
{
|
||||
$roomName = $event->roomName();
|
||||
|
||||
$this->logger->debug(sprintf('Some person enters room %s', $roomName));
|
||||
|
||||
// @todo implement logic here
|
||||
}
|
||||
|
||||
* You can found Events in AmbientLink\SDK\Event\
|
||||
* Using Ability Command? Try <info>php bin/console ability:debug --dummy</info>
|
||||
Reference in New Issue
Block a user