1.1.0 • Published 3 years ago
@mangar2/sunnyportal v1.1.0
Abstract
Contents
Meta
Class SunnyPortal
new SunnyPortal(config)
Gets current production/consumption infos from sunny portal Constructs a new sunny portal object
Example
const config = {
user: 'your user',
password: 'your password',
host: 'www.sunnyportal.com',
port: 443,
paths: {
login: '/Templates/Start.aspx',
logout: '/Templates/Logout.aspx',
production: '/Dashboard?_=1'
}
}
const sunnyportal = new SunnyPortal(config)
const messages = sunnyportal.getMessages()
console.log(messages)
SunnyPortal Parameters
Name | Type | Description | |
---|---|---|---|
config | Object | configuration options |
config properties
Name | Type | Attribute | Default | Description | |
---|---|---|---|---|---|
host | string | host of open sense map | |||
port | port | optional | 443 | portnumer of open sense map ( usually 443 ) | |
user | string | name of the login user | |||
password | string | login password | |||
paths | Object | needed paths to access the specific parts of the page |
SunnyPortal Methods
getMessages
async getMessages () => {Array.<Message>}
Gets messages to send to the client
getMessages returns
Type | Description |
---|---|
Array.<Message> | Messages to send |