@mangar2/sunnyportal
v1.1.0
Published
reads current consumption from sunny portal
Downloads
27
Readme
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 |
