This library encapsulates the API from ioBroker backend to frontend.
There are 2 connection types in it:
Connection
=> for all Web Frontends;AdminConnection
=> for Admin UI Connections, these have access to more commands.
npm run build
for one-time builds.
npm run watch
for continuous builds.
Include the socket library from Admin or Web adapter:
<script src="../lib/js/socket.io.js"></script>
Instantiate the connection:
const adminConnection = new AdminConnection({
protocol: 'ws',
host: '192.168.1.2',
port: 8081,
admin5only: false,
autoSubscribes: [],
// optional: other options
});
await adminConnection.startSocket();
await adminConnection.waitForFirstConnection();
// and use it
console.log(await adminConnection.getHosts());
- (bluefox) Improved getNotifications command
- (bluefox) Corrected the object subscribing
- (bluefox) Corrected types
- (bluefox) Allowed subscribing and unsubscribing on arrays of IDs
- (bluefox) Changed systemLang to writable, as it can be changed on the fly
- (foxriver76) fix
cjs
types export - (bluefox) Better typing for getLogs
- (bluefox) Better typing for getNotifications
- (bluefox) updated packages
- (foxriver76) port to
@iobroker/types
- (foxriver76) improve performance on
subscribeState
without wildcard
- (bluefox) Added return value for
subscribeOnInstance
- (foxriver76) Corrected import of modules
- (bluefox) Added implicit export of AdminConnection
- (jogibear9988) Updated Connection api documentation
- (bluefox) Added
subscribeStateAsync
method for legacy compatibility
- (bluefox) Added the subscribing on the specific instance messages
- (bluefox) Update packages
- (bluefox) added new method -
getObjectsById
- (rovo89) Typescript types tuning
- (bluefox) The path was removed from
socket.io
URL
- (bluefox) better detection of chained certificates
- (bluefox) packages updated
- (bluefox) Added
rename
andrenameFile
methods
- (bluefox) Made the fix for
material
andecharts
- (bluefox) Caught errors on state/object changes
- (bluefox) Special changes for vis and "nothing_selected" ID
- (bluefox) Added
log
command
- (jogibear9988) Added getObjectViewSystem and getObjectViewCustom and deprecated getObjectView
- (bluefox) Added support of authentication token
- (bluefox) Working on cloud connection
- (bluefox) Added method getCompactSystemRepositories
- (bluefox) Added ack parameter to
setState
method.
- (bluefox) Allowed call of getStates with pattern
- (bluefox) Errors on connection are handled now
- (bluefox) Added preparations for iobroker cloud
- (bluefox) Added functions to reset cache
- (bluefox) Allowed connections behind reverse proxy
- (bluefox) Added functions to reset cache
- (bluefox) Corrected cache problem by
getInstalled
andgetRepository
commands
- (bluefox) Allowed connections behind reverse proxy
- (bluefox) Added methods: subscribeFiles, unsubscribeFiles
- (bluefox) Extended
getVersion
command with update
- (AlCalzone) corrected: reload on websocket error instead of alert()-ing
- (bluefox) Added
logout
command - (bluefox) Move
getGroups
to web connection
- (jogibear998) Fix connection with web adapter
- (jogibear998 & AlCalzone) Convert package to a CommonJS/ESM hybrid
- (bluefox) Fixed
getInstalled
command
- (bluefox) Improved the vendor support
- (AlCalzone) setSystemConfig simplified
- (AlCalzone) The package was completely rewritten to make proper use of TypeScript
- (bluefox) Fix the renaming of groups
- (jogibear9988) Test release
- (bluefox) Update methods
- (UncleSamSwiss) Add release script and release workflow
- (jogibear9988) Create the Repository from the Code in https://github.com/ioBroker/adapter-react
The MIT License (MIT)
Copyright (c) 2021-2024 Jochen Kühner