mirror of
https://github.com/symfony/recipes-contrib.git
synced 2026-09-11 15:16:55 +03:00
added ambient-link ability pack
This commit is contained in:
@@ -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)%'
|
||||||
@@ -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%/"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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