open-index/open-npm huggingface dataset:
npm package: @rohmer/node-red-switchbot
Description: This is a Node-RED node for SwitchBot API. It allows you to control your SwitchBot devices from Node-RED.
Author: Matthias Rohmer
Latest version: 1.0.2

# Node Red Integration For SwitchBot

This is a Node-RED node for SwitchBot API. It allows you to control your SwitchBot devices from Node-RED.

This library is not affiliated with SwitchBot in any way.

## Installation

### Node-RED

You can install this package from the Node-RED palette manager by searching for `@rohmer/node-red-switchbot`.

### NPM

1. Navigate to your Node-RED user directory. This is usually `~/.node-red`.
2. Run `npm install @rohmer/node-red-switchbot`.
3. Restart Node-RED (`node-red-restart`).

## Available Nodes

- **SwitchBot**: Global configuration node for SwitchBot API.
- **SwitchBot | Status**: Get the status of a SwitchBot device.
- **SwitchBot | Command**: Send a command to a SwitchBot device.

## License
This project is licensed under the MIT License.
npm package: @rohu/fastify-mqtt-async
Description: Fastify wrapper for async-mqtt
Author: Eduardo Roth
Latest version: 1.0.0

# fastify-mqtt-async

Wrapper for [async-mqtt](https://www.npmjs.com/package/async-mqtt) with TS support.

## Install

```
npm i @eduardoroth/fastify-mqtt-async
```

## Using it

Add it to your fastify project with the `register` method.

```ts
import fastify from "fastify";
import { fastifyMqttAsync } from "@eduardoroth/fastify-mqtt-async";

const host = process.env.HOST ?? "localhost";
const port = process.env.PORT ? Number(process.env.PORT) : 3000;

const server = fastify();

// register plugin
server.register(fastifyMqttAsync, { url: "mqtt://localhost:1883" });

server.listen({ port, host }, (err) => {
  if (err) throw err;
});
```

Then you can use it in your methods

```ts
import { FastifyInstance } from "fastify";

export default async function (fastify: FastifyInstance) {
  fastify.get("/mqtt/ping", async function (req, reply) {
    await this.mqttClient.publish("your/topic/#", "Async Hi Mosquitto!");
    reply.send({ mqtt: "message sent!" });
  });
}
```

## License

Licensed under [MIT](./LICENSE).