From d3f171fe5502f4516a2565dfb45073b2a6690328 Mon Sep 17 00:00:00 2001 From: Yannic Labonte Date: Mon, 15 Jan 2024 18:42:47 +0100 Subject: [PATCH] Prepare release v1.7.4 --- README.md | 3 ++ docs/classes/AbstractService.html | 18 ++++---- docs/classes/CommandService.html | 26 ++++++------ docs/classes/GetStateData.html | 40 +++++++++--------- docs/classes/GetStateDataObject.html | 30 +++++++------- docs/classes/GetStateDataSysInfo.html | 46 ++++++++++----------- docs/classes/GetStateService.html | 42 +++++++++---------- docs/classes/Logger.html | 16 +++---- docs/classes/RelayDataInterpreter.html | 22 +++++----- docs/classes/RelayDataObject.html | 32 +++++++------- docs/classes/SetStateService.html | 20 ++++----- docs/classes/UsrcfgCgiService.html | 26 ++++++------ docs/enums/DosageTarget.html | 4 +- docs/enums/GetStateCategory.html | 20 ++++----- docs/enums/LogLevel.html | 4 +- docs/enums/RelayStateBitMask.html | 4 +- docs/enums/SetStateValue.html | 4 +- docs/interfaces/IGetStateCategories.html | 4 +- docs/interfaces/IGetStateServiceConfig.html | 16 +++---- docs/interfaces/ILogger.html | 10 ++--- docs/interfaces/IServiceConfig.html | 12 +++--- docs/variables/GETSTATE.html | 2 +- package.json | 2 +- 23 files changed, 203 insertions(+), 200 deletions(-) diff --git a/README.md b/README.md index 308dbf7..0d43ef9 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,9 @@ Package info ## Changelog +### Release v1.7.4 +* Dependency updates. + ### Release v1.7.3 * Dependency updates. diff --git a/docs/classes/AbstractService.html b/docs/classes/AbstractService.html index fc77601..31fe989 100644 --- a/docs/classes/AbstractService.html +++ b/docs/classes/AbstractService.html @@ -1,6 +1,6 @@ AbstractService | procon-ip

Class AbstractServiceAbstract

Abstract service implementing the common base setup for the axios requests of the specific service implementations.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

_config _endpoint _method @@ -12,23 +12,23 @@

Constructors

Properties

_endpoint: string

Specific webservice endpoint.

+

Returns AbstractService

Properties

_endpoint: string

Specific webservice endpoint.

An absolute URL, which means a path with leading slash ('/') relative to the IServiceConfig.controllerUrl (ProCon.IP base address).

-
_method: Method

HTTP request method.

+
_method: Method

HTTP request method.

Must be one of the valid HTTP request methods like GET, POST, etc. See axios/Method type:

export type Method =
| 'get' | 'GET'
| 'delete' | 'DELETE'
| 'head' | 'HEAD'
| 'options' | 'OPTIONS'
| 'post' | 'POST'
| 'put' | 'PUT'
| 'patch' | 'PATCH'
| 'purge' | 'PURGE'
| 'link' | 'LINK'
| 'unlink' | 'UNLINK'
-
_requestHeaders: {
    [key: string]: string;
}

Custom HTTP headers.

+
_requestHeaders: {
    [key: string]: string;
}

Custom HTTP headers.

Custom headers can be defined in form of a key value pair.

this._requestHeaders["Cache-Control"] = "no-cache";
 
-

Type declaration

  • [key: string]: string
log: ILogger

Logger which will be used for all logging events.

-

Accessors

  • get axiosRequestConfig(): AxiosRequestConfig<any>
  • Get an axios/AxiosRequestConfig object.

    -

    Returns AxiosRequestConfig<any>

  • get baseUrl(): string
  • Get the base url.

    +

    Type declaration

    • [key: string]: string
log: ILogger

Logger which will be used for all logging events.

+

Accessors

  • get axiosRequestConfig(): AxiosRequestConfig<any>
  • Get an axios/AxiosRequestConfig object.

    +

    Returns AxiosRequestConfig<any>

  • get url(): string
  • Get the webservice url (joined base url and endpoint).

    Returns string

    URL string (joined base url and endpoint).

    Throws

    TypeError [ERR_INVALID_URL]: Invalid URL

    -

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/CommandService.html b/docs/classes/CommandService.html index 1ff16bb..9fff70b 100644 --- a/docs/classes/CommandService.html +++ b/docs/classes/CommandService.html @@ -1,6 +1,6 @@ CommandService | procon-ip

Class CommandService

The CommandService uses the /Command.htm endpoint of the ProCon.IP pool controller to turn on manual dosage for a given amount of time/seconds.

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

_config _endpoint _method @@ -18,28 +18,28 @@

Constructors

Properties

_endpoint: string = '/Command.htm'

Specific service endpoint.

+

Returns CommandService

Properties

_endpoint: string = '/Command.htm'

Specific service endpoint.

A path relative to the IServiceConfig.controllerUrl.

-
_method: Method = 'get'

HTTP request method for this specific service endpoint. +

_method: Method = 'get'

HTTP request method for this specific service endpoint. See: axios/Method

-
_requestHeaders: {
    [key: string]: string;
}

Custom HTTP headers.

+
_requestHeaders: {
    [key: string]: string;
}

Custom HTTP headers.

Custom headers can be defined in form of a key value pair.

this._requestHeaders["Cache-Control"] = "no-cache";
 
-

Type declaration

  • [key: string]: string
log: ILogger

Logger which will be used for all logging events.

-

Accessors

  • get axiosRequestConfig(): AxiosRequestConfig<any>
  • Get an axios/AxiosRequestConfig object.

    -

    Returns AxiosRequestConfig<any>

log: ILogger

Logger which will be used for all logging events.

+

Accessors

  • get axiosRequestConfig(): AxiosRequestConfig<any>
  • Get an axios/AxiosRequestConfig object.

    +

    Returns AxiosRequestConfig<any>

  • get url(): string
  • Get the webservice url (joined base url and endpoint).

    +
  • get url(): string
  • Get the webservice url (joined base url and endpoint).

    Returns string

    URL string (joined base url and endpoint).

    Throws

    TypeError [ERR_INVALID_URL]: Invalid URL

    -

Methods

  • Parameters

    Returns Promise<number>

  • Parameters

    Returns AxiosPromise

  • Set manuel chlorine dosage for given amount of time in seconds.

    +

Methods

  • Parameters

    Returns Promise<number>

  • Parameters

    Returns AxiosPromise

  • Set manuel chlorine dosage for given amount of time in seconds.

    Parameters

    • dosageTime: number

      Dosage duration in seconds.

      -

    Returns Promise<number>

  • Set the desired relay state.

    +

Returns Promise<number>

  • Set the desired relay state.

    Parameters

    • dosageTarget: DosageTarget

      Dosage target (0 = chlorine, 1 = pH minus, 2 = pH plus).

    • dosageDuration: number

      Desired duration in seconds.

      -

    Returns Promise<number>

  • Set manuel pH minus dosage for given amount of time in seconds.

    +

Returns Promise<number>

Returns Promise<number>

Generated using TypeDoc

\ No newline at end of file +

Returns Promise<number>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/GetStateData.html b/docs/classes/GetStateData.html index b98bed4..89e42a7 100644 --- a/docs/classes/GetStateData.html +++ b/docs/classes/GetStateData.html @@ -2,7 +2,7 @@ representation for the response CSV of the GetStateService. (This might be changed/split in seperate classes in a future refactoring)

Indexable

[key: string]: any

Extend the data object instances as you like.

-

Constructors

Constructors

Properties

active categories objects @@ -25,44 +25,44 @@

Constructors

Properties

active: number[]

Lists all indices of objects that are not labeled with 'n.a.' and therefore +

Returns GetStateData

Properties

active: number[]

Lists all indices of objects that are not labeled with 'n.a.' and therefore considered to be active.

-
categories: IGetStateCategories = GetStateData.categories

Actual data objects for further processing.

+
categories: IGetStateCategories = GetStateData.categories

Actual data objects for further processing.

Ordered by CSV column position starting at 0.

-
parsed: string[][]

CSV input parsed to a simple 2-dimensional array.

+
parsed: string[][]

CSV input parsed to a simple 2-dimensional array.

Structure:

[
0: [ // line one
0: // line one, column one
1: // line one, column two
],
1: [ // line two
0: // line two, column one
...
...
]
-
raw: string

Raw CSV input string (retrieved by the GetStateService).

-

SysInfo column data.

+
raw: string

Raw CSV input string (retrieved by the GetStateService).

+

SysInfo column data.

The first line of the csv has no relation to the rest of the CSV. So it is stored seperately in here.

-
categories: IGetStateCategories = ...

Data categories as array of objects.

+
categories: IGetStateCategories = ...

Data categories as array of objects.

Category names as keys and arrays as values. These arrays list columns (referencing the parsed CSV) which fall into this category. The array values might contain simple listings of the column positions or another array containing the starting and ending index of a slice/range. Counting columns starts at 0. The value is of type any to simplify dynamic iteration without linting or parsing errors.

-

Methods

  • Get the category of a data item by its column index.

    +

Methods

  • Get the category of a data item by its column index.

    Parameters

    • index: number

      Column index

    Returns string

    Category name or string none if no category could be identified.

    -
  • Get the object id aka column index of the chlorine dosage control relay.

    -

    Returns number

  • Get the object id aka column index of the chlorine dosage control relay.

    +

    Returns number

Returns GetStateDataObject

  • Get all data objects of a given category.

    +

Returns GetStateDataObject[]

  • Get the object id aka column index of the pH minus dosage control relay.

    -

    Returns number

  • Get the object id aka column index of the pH plus dosage control relay.

    -

    Returns number

  • Parse the CSV string into a 2-dimensional array structure and into +

Returns GetStateDataObject[]

  • Get the object id aka column index of the pH minus dosage control relay.

    +

    Returns number

  • Get the object id aka column index of the pH plus dosage control relay.

    +

    Returns number

Generated using TypeDoc

\ No newline at end of file +

Returns void

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/GetStateDataObject.html b/docs/classes/GetStateDataObject.html index d0e6afa..523b485 100644 --- a/docs/classes/GetStateDataObject.html +++ b/docs/classes/GetStateDataObject.html @@ -2,7 +2,7 @@ row of the raw input!).

Hierarchy (view full)

Indexable

[key: string]: any

Making GetStateDataObject objects extensible, also allows accessing object keys using string variables.

-

Constructors

Constructors

Properties

active category categoryId @@ -23,23 +23,23 @@
  • offset: string

    Column value offset

  • gain: string

    Column value gain

  • measure: string

    Column value raw measurement

    -
  • Returns GetStateDataObject

    Properties

    active: boolean

    Indicates whether the object is considered to be active.

    +

    Returns GetStateDataObject

    Properties

    active: boolean

    Indicates whether the object is considered to be active.

    Indeed this only means the name is not 'n.a.'.

    -
    category: string

    Object instance category string.

    -
    categoryId: number

    Sub-index for each category.

    +
    category: string

    Object instance category string.

    +
    categoryId: number

    Sub-index for each category.

    Starts counting from 0 at the first object of the instances category. Used to determine e.g. the relay IDs.

    -
    displayValue: string

    Object display value.

    -
    gain: number

    Object value gain.

    -
    id: number

    Object id aka column index.

    -
    label: string

    Object label.

    -
    offset: number

    Object value offset.

    -
    raw: number

    Raw object input value.

    -
    unit: string

    Object unit.

    -
    value: string | number

    Plain (calculated) object value.

    -

    Methods

    displayValue: string

    Object display value.

    +
    gain: number

    Object value gain.

    +
    id: number

    Object id aka column index.

    +
    label: string

    Object label.

    +
    offset: number

    Object value offset.

    +
    raw: number

    Raw object input value.

    +
    unit: string

    Object unit.

    +
    value: string | number

    Plain (calculated) object value.

    +

    Methods

    • Iterate all fields of this object.

      Parameters

      • callback: ((field) => any)

        A user-defined callback.

        -
          • (field): any
          • Parameters

            • field: string

            Returns any

      Returns void

    • Set object values based on the raw input values.

      +
        • (field): any
        • Parameters

          • field: string

          Returns any

    Returns void

    • Set object values based on the raw input values.

      The input values correspond to the data rows of the represented column (except the index paramter which indeed is the column id/index itself).

      Parameters

      • index: number

        Column id/index

        @@ -48,4 +48,4 @@
      • offset: string

        Column value offset

      • gain: string

        Column value gain

      • measure: string

        Column value raw measurement

        -

      Returns void

    Generated using TypeDoc

    \ No newline at end of file +

    Returns void

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/GetStateDataSysInfo.html b/docs/classes/GetStateDataSysInfo.html index b345fb4..74e373c 100644 --- a/docs/classes/GetStateDataSysInfo.html +++ b/docs/classes/GetStateDataSysInfo.html @@ -3,7 +3,7 @@ subsequent lines of the CSV file.

    Indexable

    [key: string]: any

    Making GetStateDataSysInfo objects extensible, also allows accessing object keys using string variables.

    -

    Constructors

    Constructors

    Properties

    Constructors

    Properties

    chlorineDosageRelay: number

    Chlorine dosage relay id.

    -
    configOtherEnable: number

    Other config flags.

    +

    Returns GetStateDataSysInfo

    Properties

    chlorineDosageRelay: number

    Chlorine dosage relay id.

    +
    configOtherEnable: number

    Other config flags.

    Values are documented bitwise as follows:

    • Bit 8: Extension an SPI (0) oder DMX (1)
    • @@ -44,7 +44,7 @@
    • Bit 0: TCP-IP Boost

    See manual for more information or updates: http://www.pooldigital.de/trm/TRM_ProConIP.pdf

    -
    dosageControl: number

    Dosage control information flags.

    +
    dosageControl: number

    Dosage control information flags.

    Values are documented bitwise as follows:

    • Bit 12: pH+ enabled
    • @@ -56,7 +56,7 @@
    • Bit 0: CL enabled

    See manual for more information or updates: http://www.pooldigital.de/trm/TRM_ProConIP.pdf

    -
    ntpFaultState: number

    NTP fault state.

    +
    ntpFaultState: number

    NTP fault state.

    Values are documented bitwise as follows:

    • Bit 16: NTP available
    • @@ -66,9 +66,9 @@
    • Bit 0: Logfile

    See manual for more information or updates: http://www.pooldigital.de/trm/TRM_ProConIP.pdf

    -
    phMinusDosageRelay: number

    pH- dosage relay id.

    -
    phPlusDosageRelay: number

    pH+ dosage relay id.

    -
    resetRootCause: number

    Reset root cause.

    +
    phMinusDosageRelay: number

    pH- dosage relay id.

    +
    phPlusDosageRelay: number

    pH+ dosage relay id.

    +
    resetRootCause: number

    Reset root cause.

    Values are documented bitwise as follows:

    • Bit 4: External reset
    • @@ -78,28 +78,28 @@
    • Bit 0: SW reset

    See manual for more information or updates: http://www.pooldigital.de/trm/TRM_ProConIP.pdf

    -
    time: string
    uptime: number

    Uptime of the ProCon.IP controller at the time this data was requested.

    -
    version: string

    Current firmware version string.

    -

    Methods

    time: string
    uptime: number

    Uptime of the ProCon.IP controller at the time this data was requested.

    +
    version: string

    Current firmware version string.

    +

    Methods

    • Check whether the given GetStateDataObject object is a dosage control +

    Returns number

    • Checks if the chlorine dosage device is configured as an electrolysis cell or a pump.

      -

      Returns boolean

    • Check whether the digitial input 0 is configured as a flow sensor +

    Returns boolean

    • Checks if the chlorine dosage device is configured as an electrolysis cell or a pump.

      +

      Returns boolean

    • Check whether the digitial input 0 is configured as a flow sensor or not.

      -

      Returns boolean

    • Set values from based on a 2-dimensional array structure.

      Parameters

      • data: string[][]

        Parsed response CSV of the /GetState.csv endpoint as 2-dimensional array (see: GetStateData.parsed)

        -

      Returns void

    • Converts the object instance to a simple array of objects for better +

    Returns void

    • Converts the object instance to a simple array of objects for better handling/iteration.

      -

      Returns {
          key: string;
          value: string;
      }[]

    Generated using TypeDoc

    \ No newline at end of file +

    Returns {
        key: string;
        value: string;
    }[]

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/GetStateService.html b/docs/classes/GetStateService.html index 9dac6eb..4d81713 100644 --- a/docs/classes/GetStateService.html +++ b/docs/classes/GetStateService.html @@ -1,6 +1,6 @@ GetStateService | procon-ip

    Class GetStateService

    The GetStateService implements the AbstractService for the /GetState.csv endpoint.

    -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    _config _endpoint _method @@ -24,43 +24,43 @@

    Constructors

    Properties

    _endpoint: string = '/GetState.csv'

    Specific service endpoint.

    +

    Returns GetStateService

    Properties

    _endpoint: string = '/GetState.csv'

    Specific service endpoint.

    A path relative to the IServiceConfig.controllerUrl.

    -
    _method: Method = 'get'

    HTTP request method for this specific service endpoint. +

    _method: Method = 'get'

    HTTP request method for this specific service endpoint. See: axios/Method

    -
    _requestHeaders: {
        [key: string]: string;
    }

    Custom HTTP headers.

    +
    _requestHeaders: {
        [key: string]: string;
    }

    Custom HTTP headers.

    Custom headers can be defined in form of a key value pair.

    this._requestHeaders["Cache-Control"] = "no-cache";
     
    -

    Type declaration

    • [key: string]: string
    _updateCallback?: ((data) => any)

    An optional callback, that can be passed when calling the +

    Type declaration

    • [key: string]: string
    _updateCallback?: ((data) => any)

    An optional callback, that can be passed when calling the start method.

    Type declaration

      • (data): any
      • An optional callback, that can be passed when calling the start method.

        -

        Parameters

        Returns any

    _updateInterval: number

    Initially set via IGetStateServiceConfig. +

    Parameters

    Returns any

    _updateInterval: number

    Initially set via IGetStateServiceConfig. Can be adjusted using the setUpdateInterval method.

    -

    The actual service data object.

    -
    log: ILogger

    Logger which will be used for all logging events.

    -

    Accessors

    • get axiosRequestConfig(): AxiosRequestConfig<any>
    • Get an axios/AxiosRequestConfig object.

      -

      Returns AxiosRequestConfig<any>

    The actual service data object.

    +
    log: ILogger

    Logger which will be used for all logging events.

    +

    Accessors

    • get axiosRequestConfig(): AxiosRequestConfig<any>
    • Get an axios/AxiosRequestConfig object.

      +

      Returns AxiosRequestConfig<any>

    • get url(): string
    • Get the webservice url (joined base url and endpoint).

      +
    • get url(): string
    • Get the webservice url (joined base url and endpoint).

      Returns string

      URL string (joined base url and endpoint).

      Throws

      TypeError [ERR_INVALID_URL]: Invalid URL

      -

    Methods

    • Recursive wrapper for the polling mechanism. The next request/interval +

    Methods

    • Stage request and return the corresponding AxiosPromise.

      -

      Returns AxiosPromise<string>

    • Tells you whether the service has most recent status information or not.

      +

      Returns void

    • Stage request and return the corresponding AxiosPromise.

      +

      Returns AxiosPromise<string>

    • Tells you whether the service has most recent status information or not.

      More accurately it tells you whether the most recent request succeeded or not. So it will return true if the request succeeded and your data is up-to-date. It will return false until the service retrieved its first data and again if a subsequent request fails.

      -

      Returns boolean

    • Set the update interval.

      Parameters

      • milliseconds: number

        Update interval in milliseconds [ms].

        -

      Returns void

    • Start the service.

      +

    Returns void

    Returns void

    Generated using TypeDoc

    \ No newline at end of file +

    Returns Promise<GetStateData>

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/Logger.html b/docs/classes/Logger.html index 3fe15e7..b28a8fa 100644 --- a/docs/classes/Logger.html +++ b/docs/classes/Logger.html @@ -3,7 +3,7 @@ plus the used log level in uppercase. You can write your own custom logger or pass any other (e.g. ioBroker has a suitable logger on board), that matches the ILogger interface.

    -

    Implements

    Constructors

    Implements

    Constructors

    Accessors

    Methods

    debug error @@ -12,17 +12,17 @@ warn

    Constructors

    • Initialize a new Logger.

      Parameters

      • Optional logLevel: LogLevel

        Optionally define a custom log level. Default is LogLevel.INFO.

        -

      Returns Logger

    Accessors

    • get timestamp(): string
    • Get current datetime with milliseconds.

      +

    Returns Logger

    Accessors

    • get timestamp(): string
    • Get current datetime with milliseconds.

      Returns string

      An ISO 8601 conform timestamp (e.g. 2020-10-10T12:34:56.789Z).

      -

    Methods

    • ILogger a message with severity debug to console.

      +

    Methods

    • ILogger a message with severity debug to console.

      Parameters

      • message: string

        The debug message.

        -

      Returns void

    • ILogger a message with severity error to console.

      +

    Returns void

    • ILogger a message with severity error to console.

      Parameters

      • message: string

        The error message.

        -

      Returns void

    • ILogger a message with severity info.

      +

    Returns void

    • ILogger a message with severity info.

      Parameters

      • message: string

        The information.

        -

      Returns void

    • Set the actual log level

      +

    Returns void

    • Set the actual log level

      Method calls to lower log levels than the one defined here, will not generate any output.

      -

      Parameters

      Returns void

    • ILogger a message with severity warn to console.

      +

      Parameters

      Returns void

    • ILogger a message with severity warn to console.

      Parameters

      • message: string

        The warning.

        -

      Returns void

    Generated using TypeDoc

    \ No newline at end of file +

    Returns void

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/RelayDataInterpreter.html b/docs/classes/RelayDataInterpreter.html index 2426245..000a842 100644 --- a/docs/classes/RelayDataInterpreter.html +++ b/docs/classes/RelayDataInterpreter.html @@ -1,6 +1,6 @@ RelayDataInterpreter | procon-ip

    Class RelayDataInterpreter

    The RelayDataInterpreter is a helper for all the binary operations that are necessary to read and write relay states.

    -

    Constructors

    Constructors

    Properties

    Methods

    evaluate @@ -12,9 +12,9 @@ setOff setOn

    Constructors

    Properties

    bitStates: [number, number]

    A pair of bit patterns in decimal representation according to the way the +

    Parameters

    Returns RelayDataInterpreter

    Properties

    bitStates: [number, number]

    A pair of bit patterns in decimal representation according to the way the /usrcfg.cgi endpoints wants its values.

    -
    log: ILogger

    Methods

    log: ILogger

    Methods

    Returns RelayDataInterpreter

    Generated using TypeDoc

    \ No newline at end of file +

    Parameters

    Returns [number, number]

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/RelayDataObject.html b/docs/classes/RelayDataObject.html index 0e89a7b..f2cccdd 100644 --- a/docs/classes/RelayDataObject.html +++ b/docs/classes/RelayDataObject.html @@ -1,7 +1,7 @@ RelayDataObject | procon-ip

    Class RelayDataObject

    The RelayDataObject extends the GetStateDataObject by an additional magic bitMask attribute, that determines the correct bitmask to toggle the relay's state.

    -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    active category categoryId @@ -18,21 +18,21 @@ set

    Constructors

    Properties

    active: boolean

    Indicates whether the object is considered to be active.

    +

    Returns RelayDataObject

    Properties

    active: boolean

    Indicates whether the object is considered to be active.

    Indeed this only means the name is not 'n.a.'.

    -
    category: string

    Object instance category string.

    -
    categoryId: number

    Sub-index for each category.

    +
    category: string

    Object instance category string.

    +
    categoryId: number

    Sub-index for each category.

    Starts counting from 0 at the first object of the instances category. Used to determine e.g. the relay IDs.

    -
    displayValue: string

    Object display value.

    -
    gain: number

    Object value gain.

    -
    id: number

    Object id aka column index.

    -
    label: string

    Object label.

    -
    offset: number

    Object value offset.

    -
    raw: number

    Raw object input value.

    -
    unit: string

    Object unit.

    -
    value: string | number

    Plain (calculated) object value.

    -

    Accessors

    displayValue: string

    Object display value.

    +
    gain: number

    Object value gain.

    +
    id: number

    Object id aka column index.

    +
    label: string

    Object label.

    +
    offset: number

    Object value offset.

    +
    raw: number

    Raw object input value.

    +
    unit: string

    Object unit.

    +
    value: string | number

    Plain (calculated) object value.

    +

    Accessors

    • get bitMask(): number
    • Returns the bit mask for toggling the relay's state using the /usrcfg.cgi endpoint (see: UsrcfgCgiService).

      The service endpoint expects two input values, one defining on/off states and another one for the auto-mode on/off. Both values are simple bit @@ -42,9 +42,9 @@ state of every single relay to determine the values you need to change a single relays state. This is, where the RelayDataInterpreter comes in.

      -

      Returns number

    Methods

    Methods

    • Set object values based on the raw input values.

      +
        • (field): any
        • Parameters

          • field: string

          Returns any

    Returns void

    • Set object values based on the raw input values.

      The input values correspond to the data rows of the represented column (except the index paramter which indeed is the column id/index itself).

      Parameters

      • index: number

        Column id/index

        @@ -53,4 +53,4 @@
      • offset: string

        Column value offset

      • gain: string

        Column value gain

      • measure: string

        Column value raw measurement

        -

      Returns void

    Generated using TypeDoc

    \ No newline at end of file +

    Returns void

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/SetStateService.html b/docs/classes/SetStateService.html index 8aa2993..c6c1a2a 100644 --- a/docs/classes/SetStateService.html +++ b/docs/classes/SetStateService.html @@ -1,6 +1,6 @@ SetStateService | procon-ip

    Class SetStateService

    The CommandService uses the /SetState.pl endpoint of the ProCon.IP pool controller to turn on relays for a specified time span.

    -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    _config _endpoint _method @@ -14,22 +14,22 @@

    Constructors

    Properties

    _endpoint: string = '/SetState.pl'

    Specific service endpoint.

    +

    Returns SetStateService

    Properties

    _endpoint: string = '/SetState.pl'

    Specific service endpoint.

    A path relative to the IServiceConfig.controllerUrl.

    -
    _method: Method = 'get'

    HTTP request method for this specific service endpoint. +

    _method: Method = 'get'

    HTTP request method for this specific service endpoint. See: axios/Method

    -
    _requestHeaders: {
        [key: string]: string;
    }

    Custom HTTP headers.

    +
    _requestHeaders: {
        [key: string]: string;
    }

    Custom HTTP headers.

    Custom headers can be defined in form of a key value pair.

    this._requestHeaders["Cache-Control"] = "no-cache";
     
    -

    Type declaration

    • [key: string]: string
    log: ILogger

    Logger which will be used for all logging events.

    -

    Accessors

    • get axiosRequestConfig(): AxiosRequestConfig<any>
    • Get an axios/AxiosRequestConfig object.

      -

      Returns AxiosRequestConfig<any>

    log: ILogger

    Logger which will be used for all logging events.

    +

    Accessors

    • get axiosRequestConfig(): AxiosRequestConfig<any>
    • Get an axios/AxiosRequestConfig object.

      +

      Returns AxiosRequestConfig<any>

    • get url(): string
    • Get the webservice url (joined base url and endpoint).

      +
    • get url(): string
    • Get the webservice url (joined base url and endpoint).

      Returns string

      URL string (joined base url and endpoint).

      Throws

      TypeError [ERR_INVALID_URL]: Invalid URL

      -

    Methods

    • Parameters

      • relayNo: number
      • duration: number

      Returns Promise<number>

    • Set relay on-timer.

      +

    Methods

    • Parameters

      • relayNo: number
      • duration: number

      Returns Promise<number>

    • Set relay on-timer.

      Parameters

      • relayNo: number

        Target relay number (count starting from 1).

      • duration: number

        Desired timer duration in seconds.

        -

      Returns Promise<number>

    Generated using TypeDoc

    \ No newline at end of file +

    Returns Promise<number>

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/UsrcfgCgiService.html b/docs/classes/UsrcfgCgiService.html index 27d7818..ba8820d 100644 --- a/docs/classes/UsrcfgCgiService.html +++ b/docs/classes/UsrcfgCgiService.html @@ -4,7 +4,7 @@ states for all relays at once. This means considering the states of all relays, those which states should be changed as well as the ones which states not gonna to be changed.

    -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    _config _endpoint _method @@ -28,28 +28,28 @@
  • getStateService: GetStateService

    A corresponding GetStateService (must address the same pool controller)

  • relayDataInterpreter: RelayDataInterpreter

    An instance of RelayDataInterpreter.

    -
  • Returns UsrcfgCgiService

    Properties

    _endpoint: string = '/usrcfg.cgi'

    Specific service endpoint.

    +

    Returns UsrcfgCgiService

    Properties

    _endpoint: string = '/usrcfg.cgi'

    Specific service endpoint.

    A path relative to the IServiceConfig.controllerUrl.

    -
    _method: Method = 'post'

    HTTP request method for this specific service endpoint. +

    _method: Method = 'post'

    HTTP request method for this specific service endpoint. See: axios/Method

    -
    _requestHeaders: {
        [key: string]: string;
    }

    Custom HTTP headers.

    +
    _requestHeaders: {
        [key: string]: string;
    }

    Custom HTTP headers.

    Custom headers can be defined in form of a key value pair.

    this._requestHeaders["Cache-Control"] = "no-cache";
     
    -

    Type declaration

    • [key: string]: string
    getStateService: GetStateService
    log: ILogger

    Logger which will be used for all logging events.

    -
    relayDataInterpreter: RelayDataInterpreter
    stateData: GetStateData

    Accessors

    • get axiosRequestConfig(): AxiosRequestConfig<any>
    • Get an axios/AxiosRequestConfig object.

      -

      Returns AxiosRequestConfig<any>

    getStateService: GetStateService
    log: ILogger

    Logger which will be used for all logging events.

    +
    relayDataInterpreter: RelayDataInterpreter
    stateData: GetStateData

    Accessors

    • get axiosRequestConfig(): AxiosRequestConfig<any>
    • Get an axios/AxiosRequestConfig object.

      +

      Returns AxiosRequestConfig<any>

    • get url(): string
    • Get the webservice url (joined base url and endpoint).

      +
    • get url(): string
    • Get the webservice url (joined base url and endpoint).

      Returns string

      URL string (joined base url and endpoint).

      Throws

      TypeError [ERR_INVALID_URL]: Invalid URL

      -

    Methods

    • Set the given relay in auto mode.

      +

    Methods

    • Switch the given relay off.

      +

    Returns Promise<number>

    • Switch the given relay on.

      +

    Returns Promise<number>

    • Set the desired relay state.

      +

    Returns Promise<number>

    Generated using TypeDoc

    \ No newline at end of file +

    Returns Promise<number>

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/enums/DosageTarget.html b/docs/enums/DosageTarget.html index fbafa13..75182e2 100644 --- a/docs/enums/DosageTarget.html +++ b/docs/enums/DosageTarget.html @@ -1,7 +1,7 @@ DosageTarget | procon-ip

    Enumeration DosageTarget

    This enum can be used with the CommandService.setDosage method. But there are also shorthand wrappers for all states (CommandService.setChlorineDosage, CommandService.setPhPlusDosage, CommandService.setPhMinusDosage) that can be used.

    -

    Enumeration Members

    Enumeration Members

    Enumeration Members

    CHLORINE: 0
    PH_MINUS: 1
    PH_PLUS: 2

    Generated using TypeDoc

    \ No newline at end of file +

    Enumeration Members

    CHLORINE: 0
    PH_MINUS: 1
    PH_PLUS: 2

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/enums/GetStateCategory.html b/docs/enums/GetStateCategory.html index b167afe..1abd80c 100644 --- a/docs/enums/GetStateCategory.html +++ b/docs/enums/GetStateCategory.html @@ -2,7 +2,7 @@ GetStateData.getDataObjectsByCategory.

    Categories are based on the official API documentation.

    See manual (search for GetState.csv): http://www.pooldigital.de/trm/TRM_ProConIP.pdf

    -

    Enumeration Members

    Enumeration Members

    Enumeration Members

    ANALOG: "analog"

    Category for analog channels.

    -
    CANISTER: "canister"

    Category for canister filling levels.

    -
    CANISTER_CONSUMPTION: "canisterConsumptions"

    Category for canister consumptions.

    -
    DIGITAL_INPUT: "digitalInput"

    Category for digital inputs.

    -
    ELECTRODES: "electrodes"

    Category for electrode readings.

    -
    EXTERNAL_RELAYS: "externalRelays"

    Category for external relays.

    -
    RELAYS: "relays"

    Category for internal relays.

    -
    TEMPERATURES: "temperatures"

    Category for temperature sensor values.

    -
    TIME: "time"

    Internal time of the ProCon.IP when processing the corresponding request. +

    CANISTER: "canister"

    Category for canister filling levels.

    +
    CANISTER_CONSUMPTION: "canisterConsumptions"

    Category for canister consumptions.

    +
    DIGITAL_INPUT: "digitalInput"

    Category for digital inputs.

    +
    ELECTRODES: "electrodes"

    Category for electrode readings.

    +
    EXTERNAL_RELAYS: "externalRelays"

    Category for external relays.

    +
    RELAYS: "relays"

    Category for internal relays.

    +
    TEMPERATURES: "temperatures"

    Category for temperature sensor values.

    +
    TIME: "time"

    Internal time of the ProCon.IP when processing the corresponding request. Hence, there is only one item in this category.

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/enums/LogLevel.html b/docs/enums/LogLevel.html index 60aeddf..e8f7917 100644 --- a/docs/enums/LogLevel.html +++ b/docs/enums/LogLevel.html @@ -1,5 +1,5 @@ -LogLevel | procon-ip

    Enumeration LogLevel

    Enumeration Members

    DEBUG +LogLevel | procon-ip

    Generated using TypeDoc

    \ No newline at end of file +

    Enumeration Members

    DEBUG: 1
    ERROR: 4
    INFO: 2
    WARN: 3

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/enums/RelayStateBitMask.html b/docs/enums/RelayStateBitMask.html index 28ef034..566a362 100644 --- a/docs/enums/RelayStateBitMask.html +++ b/docs/enums/RelayStateBitMask.html @@ -4,6 +4,6 @@
  • msb: 0 = auto, 1 = manual
  • It is used by the RelayDataInterpreter and the UsrcfgCgiService.

    -

    Enumeration Members

    Enumeration Members

    Enumeration Members

    manual: 2
    on: 1

    Generated using TypeDoc

    \ No newline at end of file +

    Enumeration Members

    manual: 2
    on: 1

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/enums/SetStateValue.html b/docs/enums/SetStateValue.html index ac6caec..89be651 100644 --- a/docs/enums/SetStateValue.html +++ b/docs/enums/SetStateValue.html @@ -1,7 +1,7 @@ SetStateValue | procon-ip

    Enumeration SetStateValue

    This enum can be used with the UsrcfgCgiService.setState method. But there are also shorthand wrappers for all states (UsrcfgCgiService.setOn, UsrcfgCgiService.setOff, UsrcfgCgiService.setAuto) that can be used.

    -

    Enumeration Members

    Enumeration Members

    Enumeration Members

    AUTO: 2
    OFF: 0
    ON: 1

    Generated using TypeDoc

    \ No newline at end of file +

    Enumeration Members

    AUTO: 2
    OFF: 0
    ON: 1

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/IGetStateCategories.html b/docs/interfaces/IGetStateCategories.html index 2db7c8a..1ea2404 100644 --- a/docs/interfaces/IGetStateCategories.html +++ b/docs/interfaces/IGetStateCategories.html @@ -1,4 +1,4 @@ -IGetStateCategories | procon-ip

    Interface IGetStateCategories

    interface IGetStateCategories {
        analog: number[];
        canister: number[];
        canisterConsumptions: number[];
        digitalInput: number[];
        electrodes: number[];
        externalRelays: number[];
        relays: number[];
        temperatures: number[];
        time: number[];
    }

    Properties

    analog +IGetStateCategories | procon-ip

    Interface IGetStateCategories

    interface IGetStateCategories {
        analog: number[];
        canister: number[];
        canisterConsumptions: number[];
        digitalInput: number[];
        electrodes: number[];
        externalRelays: number[];
        relays: number[];
        temperatures: number[];
        time: number[];
    }

    Properties

    analog: number[]
    canister: number[]
    canisterConsumptions: number[]
    digitalInput: number[]
    electrodes: number[]
    externalRelays: number[]
    relays: number[]
    temperatures: number[]
    time: number[]

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    analog: number[]
    canister: number[]
    canisterConsumptions: number[]
    digitalInput: number[]
    electrodes: number[]
    externalRelays: number[]
    relays: number[]
    temperatures: number[]
    time: number[]

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/IGetStateServiceConfig.html b/docs/interfaces/IGetStateServiceConfig.html index 3ebc0dc..6247ccd 100644 --- a/docs/interfaces/IGetStateServiceConfig.html +++ b/docs/interfaces/IGetStateServiceConfig.html @@ -1,6 +1,6 @@ IGetStateServiceConfig | procon-ip

    Interface IGetStateServiceConfig

    Extend common IServiceConfig with special parameters that only apply to the polling characteristics of this service.

    -
    interface IGetStateServiceConfig {
        basicAuth: boolean;
        controllerUrl: string;
        errorTolerance: number;
        password?: string;
        requestHeaders?: {
            [key: string]: string;
        };
        timeout: number;
        updateInterval: number;
        username?: string;
    }

    Hierarchy (view full)

    Properties

    interface IGetStateServiceConfig {
        basicAuth: boolean;
        controllerUrl: string;
        errorTolerance: number;
        password?: string;
        requestHeaders?: {
            [key: string]: string;
        };
        timeout: number;
        updateInterval: number;
        username?: string;
    }

    Hierarchy (view full)

    Properties

    basicAuth: boolean

    Enable HTTP basic auth.

    -
    controllerUrl: string

    Controller URL must be a valid URL string with leading protocol scheme +

    controllerUrl: string

    Controller URL must be a valid URL string with leading protocol scheme (e.g. 'http://') and should point to the ProCon.IP HTTP root. This address will be combined with the endpoint (e.g. "/GetState.csv") to build the request address. A trailing slash will be added automatically if needed.

    -
    errorTolerance: number

    Define how many HTTP request errors to tolerate before raising an error.

    -
    password?: string

    HTTP basic auth pass. Optional.

    -
    requestHeaders?: {
        [key: string]: string;
    }

    Type declaration

    • [key: string]: string
    timeout: number

    Define request timeout.

    -
    updateInterval: number

    Interval [ms] between two webservice polling requests.

    -
    username?: string

    HTTP basic auth username. Optional.

    -

    Generated using TypeDoc

    \ No newline at end of file +
    errorTolerance: number

    Define how many HTTP request errors to tolerate before raising an error.

    +
    password?: string

    HTTP basic auth pass. Optional.

    +
    requestHeaders?: {
        [key: string]: string;
    }

    Type declaration

    • [key: string]: string
    timeout: number

    Define request timeout.

    +
    updateInterval: number

    Interval [ms] between two webservice polling requests.

    +
    username?: string

    HTTP basic auth username. Optional.

    +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/ILogger.html b/docs/interfaces/ILogger.html index 9ca4ebb..201ab2d 100644 --- a/docs/interfaces/ILogger.html +++ b/docs/interfaces/ILogger.html @@ -1,15 +1,15 @@ ILogger | procon-ip

    Interface ILogger

    Interface for compatible loggers.

    Must at least support the log levels debug, info, warn and error.

    -
    interface ILogger {
        debug(message): void;
        error(message): void;
        info(message): void;
        warn(message): void;
    }

    Implemented by

    Methods

    interface ILogger {
        debug(message): void;
        error(message): void;
        info(message): void;
        warn(message): void;
    }

    Implemented by

    Methods

    • ILogger a message with severity debug.

      Parameters

      • message: string

        The debug message.

        -

      Returns void

    • ILogger a message with severity error.

      +

    Returns void

    • ILogger a message with severity error.

      Parameters

      • message: string

        The error message.

        -

      Returns void

    • ILogger a message with severity info.

      +

    Returns void

    • ILogger a message with severity info.

      Parameters

      • message: string

        The information.

        -

      Returns void

    • ILogger a message with severity warn.

      +

    Returns void

    Generated using TypeDoc

    \ No newline at end of file +

    Returns void

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/IServiceConfig.html b/docs/interfaces/IServiceConfig.html index 48abf45..26a3791 100644 --- a/docs/interfaces/IServiceConfig.html +++ b/docs/interfaces/IServiceConfig.html @@ -1,17 +1,17 @@ IServiceConfig | procon-ip

    Interface IServiceConfig

    interface IServiceConfig {
        basicAuth: boolean;
        controllerUrl: string;
        password?: string;
        requestHeaders?: {
            [key: string]: string;
        };
        timeout: number;
        username?: string;
        [key: string]: any;
    }

    Hierarchy (view full)

    Indexable

    [key: string]: any

    Configurations might contain any other values/keys, that do not conflict with valid configuration parameters.

    -

    Properties

    Properties

    basicAuth: boolean

    Enable HTTP basic auth.

    -
    controllerUrl: string

    Controller URL must be a valid URL string with leading protocol scheme +

    controllerUrl: string

    Controller URL must be a valid URL string with leading protocol scheme (e.g. 'http://') and should point to the ProCon.IP HTTP root. This address will be combined with the endpoint (e.g. "/GetState.csv") to build the request address. A trailing slash will be added automatically if needed.

    -
    password?: string

    HTTP basic auth pass. Optional.

    -
    requestHeaders?: {
        [key: string]: string;
    }

    Type declaration

    • [key: string]: string
    timeout: number

    Define request timeout.

    -
    username?: string

    HTTP basic auth username. Optional.

    -

    Generated using TypeDoc

    \ No newline at end of file +
    password?: string

    HTTP basic auth pass. Optional.

    +
    requestHeaders?: {
        [key: string]: string;
    }

    Type declaration

    • [key: string]: string
    timeout: number

    Define request timeout.

    +
    username?: string

    HTTP basic auth username. Optional.

    +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/variables/GETSTATE.html b/docs/variables/GETSTATE.html index 105c215..56b12da 100644 --- a/docs/variables/GETSTATE.html +++ b/docs/variables/GETSTATE.html @@ -1,2 +1,2 @@ GETSTATE | procon-ip

    Variable GETSTATEConst

    GETSTATE: string = ...

    Response payload of the /GetState.csv endpoint.

    -

    Deprecated

    Generated using TypeDoc

    \ No newline at end of file +

    Deprecated

    Generated using TypeDoc

    \ No newline at end of file diff --git a/package.json b/package.json index aa7f835..a104567 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "procon-ip", - "version": "1.7.3", + "version": "1.7.4", "description": "Library for the ProCon.IP pool controller", "license": "MIT", "homepage": "https://github.com/ylabonte/procon-ip#readme",