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());
- (@GermanBluefox) Added the log message type
- (@GermanBluefox) Changed behavior by timeout: do not cache such responses
- (@GermanBluefox) Added new
socket.io
namespaceiob
- (@GermanBluefox) Migrated to eslint@9
- (@GermanBluefox) Breaking change: all thrown errors are now instances of
Error
class
- (@GermanBluefox) made protocol and host optional
- (@GermanBluefox) Corrected typing of
CompactInstanceInfo
- (@GermanBluefox) Corrected typing of cmdExec
- (@GermanBluefox) Corrected upgradeController
- (@GermanBluefox) Added admin functions: upgradeAdapterWithWebserver, upgradeController, upgradeOsPackages, updateLicenses
- (@GermanBluefox) Better typing for subscribeOnInstance
- (@GermanBluefox) Added source files for typescript
- (@GermanBluefox) Replaced the SystemConfig type with ioBroker.SystemConfigObject
- (@GermanBluefox) Allowed calling getObjectView, getObjectViewSystem and getObjectViewCustom without options
- (@GermanBluefox) Improved getNotifications command
- (@GermanBluefox) Corrected the object subscribing
- (@GermanBluefox) Corrected types
- (@GermanBluefox) Allowed subscribing and unsubscribing on arrays of IDs
- (@GermanBluefox) Changed systemLang to writable, as it can be changed on the fly
- (foxriver76) fix
cjs
types export - (@GermanBluefox) Better typing for getLogs
- (@GermanBluefox) Better typing for getNotifications
- (@GermanBluefox) updated packages
- (foxriver76) port to
@iobroker/types
- (foxriver76) improve performance on
subscribeState
without wildcard
- (@GermanBluefox) Added return value for
subscribeOnInstance
- (foxriver76) Corrected import of modules
- (@GermanBluefox) Added implicit export of AdminConnection
- (jogibear9988) Updated Connection api documentation
- (@GermanBluefox) Added
subscribeStateAsync
method for legacy compatibility
- (@GermanBluefox) Added the subscribing on the specific instance messages
- (@GermanBluefox) Update packages
- (@GermanBluefox) added new method -
getObjectsById
- (rovo89) Typescript types tuning
- (@GermanBluefox) The path was removed from
socket.io
URL
- (@GermanBluefox) better detection of chained certificates
- (@GermanBluefox) packages updated
- (@GermanBluefox) Added
rename
andrenameFile
methods
- (@GermanBluefox) Made the fix for
material
andecharts
- (@GermanBluefox) Caught errors on state/object changes
- (@GermanBluefox) Special changes for vis and "nothing_selected" ID
- (@GermanBluefox) Added
log
command
- (jogibear9988) Added getObjectViewSystem and getObjectViewCustom and deprecated getObjectView
- (@GermanBluefox) Added support of authentication token
- (@GermanBluefox) Working on cloud connection
- (@GermanBluefox) Added method getCompactSystemRepositories
- (@GermanBluefox) Added ack parameter to
setState
method.
- (@GermanBluefox) Allowed call of getStates with pattern
- (@GermanBluefox) Errors on connection are handled now
- (@GermanBluefox) Added preparations for iobroker cloud
- (@GermanBluefox) Added functions to reset cache
- (@GermanBluefox) Allowed connections behind reverse proxy
- (@GermanBluefox) Added functions to reset cache
- (@GermanBluefox) Corrected cache problem by
getInstalled
andgetRepository
commands
- (@GermanBluefox) Allowed connections behind reverse proxy
- (@GermanBluefox) Added methods: subscribeFiles, unsubscribeFiles
- (@GermanBluefox) Extended
getVersion
command with update
- (AlCalzone) corrected: reload on websocket error instead of alert()-ing
- (@GermanBluefox) Added
logout
command - (@GermanBluefox) Move
getGroups
to web connection
- (jogibear998) Fix connection with web adapter
- (jogibear998 & AlCalzone) Convert package to a CommonJS/ESM hybrid
- (@GermanBluefox) Fixed
getInstalled
command
- (@GermanBluefox) Improved the vendor support
- (AlCalzone) setSystemConfig simplified
- (AlCalzone) The package was completely rewritten to make proper use of TypeScript
- (@GermanBluefox) Fix the renaming of groups
- (jogibear9988) Test release
- (@GermanBluefox) 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