fix(release): add npm registries to release config and expand documentation for UniversalDevice architecture and smart-home features
This commit is contained in:
39
readme.md
39
readme.md
@@ -468,6 +468,8 @@ type TFeatureType =
|
||||
|
||||
### Custom Device Creation
|
||||
|
||||
Use the factory functions for creating devices with specific features:
|
||||
|
||||
```typescript
|
||||
import { createScanner, createPrinter, createSpeaker } from '@ecobridge.xyz/devicemanager';
|
||||
|
||||
@@ -487,8 +489,7 @@ const printer = createPrinter({
|
||||
name: 'Office Printer',
|
||||
address: '192.168.1.51',
|
||||
port: 631,
|
||||
ippPath: '/ipp/print',
|
||||
txtRecords: {},
|
||||
txtRecords: { rp: '/ipp/print' },
|
||||
});
|
||||
|
||||
// Create a Sonos speaker
|
||||
@@ -498,7 +499,37 @@ const speaker = createSpeaker({
|
||||
address: '192.168.1.52',
|
||||
port: 1400,
|
||||
protocol: 'sonos',
|
||||
txtRecords: {},
|
||||
});
|
||||
```
|
||||
|
||||
### Smart Home Factory Functions
|
||||
|
||||
```typescript
|
||||
import {
|
||||
createSmartLight,
|
||||
createSmartSwitch,
|
||||
createSmartSensor,
|
||||
createSmartClimate,
|
||||
createSmartCover,
|
||||
createSmartLock,
|
||||
createSmartFan,
|
||||
createSmartCamera,
|
||||
} from '@ecobridge.xyz/devicemanager';
|
||||
|
||||
// Create devices with Home Assistant integration
|
||||
const light = createSmartLight({
|
||||
id: 'living-room-light',
|
||||
name: 'Living Room Light',
|
||||
address: 'homeassistant.local',
|
||||
port: 8123,
|
||||
entityId: 'light.living_room',
|
||||
protocol: 'home-assistant',
|
||||
protocolClient: haClient, // Your HomeAssistantProtocol instance
|
||||
capabilities: {
|
||||
supportsBrightness: true,
|
||||
supportsColorTemp: true,
|
||||
supportsRgb: true,
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
@@ -563,7 +594,7 @@ const maybePrint = device.getFeature<PrintFeature>('print'); // undefined
|
||||
|
||||
## 🙏 Credits
|
||||
|
||||
Built with love using:
|
||||
Built with ❤️ using:
|
||||
- [bonjour-service](https://github.com/onlxltd/bonjour-service) - mDNS discovery
|
||||
- [node-ssdp](https://github.com/diversario/node-ssdp) - SSDP/UPnP discovery
|
||||
- [net-snmp](https://github.com/markabrahams/node-net-snmp) - SNMP protocol
|
||||
|
||||
Reference in New Issue
Block a user