Skip to content

Make widget name optional#34

Merged
iMicknl merged 1 commit intomasterfrom
fix/add_optional_widget_name
Aug 14, 2020
Merged

Make widget name optional#34
iMicknl merged 1 commit intomasterfrom
fix/add_optional_widget_name

Conversation

@iMicknl
Copy link
Owner

@iMicknl iMicknl commented Aug 14, 2020

Fixes iMicknl/ha-tahoma#205

@tetienne would be good to use the definitions below for the unit tests at some point. The top one with available: false has indeed issues

Do you know a way to not break the component, if we miss some required strings?

    {
      "creationTime": 1472213846000,
      "lastUpdateTime": 1472213846000,
      "label": "ZWAVE (2#1)",
      "deviceURL": "zwave://xxxx-xxxx-xxxx/2#1",
      "shortcut": false,
      "controllableName": "zwave:ZWaveOccupancySensor",
      "definition": {
        "commands": [],
        "states": [],
        "dataProperties": [],
        "qualifiedName": "zwave:ZWaveOccupancySensor",
        "type": "UNKNOWN"
      },
      "available": false,
      "enabled": true,
      "placeOID": "xxx",
      "type": 0,
      "oid": "xxx-xxx-xxx-xxx-xxx"
    },
    {
      "creationTime": 1472213846000,
      "lastUpdateTime": 1472213846000,
      "label": "ZWAVE (2#2)",
      "deviceURL": "zwave://xxxx-xxxx-xxxx/2#2",
      "shortcut": false,
      "controllableName": "zwave:ZWaveTemperatureSensor",
      "definition": {
        "commands": [
          {
            "commandName": "refreshTemperature",
            "nparams": 0
          }
        ],
        "states": [
          {
            "values": [
              "failed"
            ],
            "type": "DiscreteState",
            "qualifiedName": "core:DeviceDefectState"
          },
          {
            "type": "DataState",
            "qualifiedName": "core:NeighboursAddressesState"
          },
          {
            "type": "ContinuousState",
            "qualifiedName": "core:TemperatureState"
          }
        ],
        "dataProperties": [],
        "widgetName": "TemperatureSensor",
        "uiClass": "TemperatureSensor",
        "qualifiedName": "zwave:ZWaveTemperatureSensor",
        "type": "SENSOR"
      },
      "attributes": [
        {
          "name": "core:MeasuredValueType",
          "type": 3,
          "value": "core:TemperatureInCelcius"
        }
      ],
      "available": false,
      "enabled": true,
      "placeOID": "xxx",
      "widget": "TemperatureSensor",
      "type": 2,
      "oid": "xxx-xxx-xxx-xxx-xxx",
      "uiClass": "TemperatureSensor"
    },
    {
      "creationTime": 1472213846000,
      "lastUpdateTime": 1472213846000,
      "label": "ZWAVE (2#3)",
      "deviceURL": "zwave://xxxx-xxxx-xxxx/2#3",
      "shortcut": false,
      "controllableName": "zwave:ZWaveLightSensor",
      "definition": {
        "commands": [],
        "states": [
          {
            "values": [
              "failed"
            ],
            "type": "DiscreteState",
            "qualifiedName": "core:DeviceDefectState"
          },
          {
            "type": "ContinuousState",
            "qualifiedName": "core:LuminanceState"
          },
          {
            "type": "DataState",
            "qualifiedName": "core:NeighboursAddressesState"
          }
        ],
        "dataProperties": [],
        "widgetName": "LuminanceSensor",
        "uiClass": "LightSensor",
        "qualifiedName": "zwave:ZWaveLightSensor",
        "type": "SENSOR"
      },
      "attributes": [
        {
          "name": "core:MeasuredValueType",
          "type": 3,
          "value": "core:LuminanceInLux"
        }
      ],
      "available": false,
      "enabled": true,
      "placeOID": "xxx",
      "widget": "LuminanceSensor",
      "type": 2,
      "oid": "xxx-xxx-xxx-xxx-xxx",
      "uiClass": "LightSensor"
    }

@iMicknl iMicknl requested a review from tetienne August 14, 2020 11:20
@tetienne
Copy link
Collaborator

@iMicknl We have to do for all the parameters what you did for the widget name in this PR: make them optional. Or only take **kwargs as parameter.

@tetienne
Copy link
Collaborator

As you know now how mock async http request, it would be nice to add a unit test using the setup of this PR, like this: https://github.com/tetienne/somfy-open-api/blob/master/tests/test_somfy_api.py#L19

@iMicknl
Copy link
Owner Author

iMicknl commented Aug 14, 2020

@tetienne can we merge this one first? I am fine by adding tests at some point, however would be great to add this quickly to unblock someone of using the new integration.

@tetienne
Copy link
Collaborator

Are we sure this time we won't miss any fields? If yes I'm good.

@iMicknl iMicknl merged commit c1f025f into master Aug 14, 2020
@iMicknl iMicknl deleted the fix/add_optional_widget_name branch August 14, 2020 16:42
tetienne pushed a commit that referenced this pull request Feb 14, 2023
iMicknl added a commit that referenced this pull request Jan 29, 2026
# API Documentation Changelog

## Overview
This document details all changes made to `docs/api/index.html` in the
v2/apiDocs branch compared to v2/main.

---

## 1. Library and Resource Updates

### jQuery Library Versions
- **Old**: `jquery-1.10.2.js` and `jquery-1.10.2-ui.js`
- **New**: `jquery.min.js` and `jquery-ui.min.js`
- **Impact**: Updated to minified versions for better performance

### Stylesheet and Resource Links
- Normalized self-closing tags: `/>` → `>`
- Updated HTTP charset: `utf-8` → `windows-1252` (in meta tag)

---

## 2. HTML Formatting and Encoding Changes

### HTML Entity Encoding
All HTML entity-encoded quotes converted to literal quotes throughout
JSON examples:
- `"` → `"`
- Applied consistently across all JSON sample values in the
documentation

### Self-Closing Tag Normalization
- `<br/>` → `<br>`
- `<link ... />` → `<link ... >`
- Applied to all HTML elements in the documentation

### Table Structure
- Added `<tbody>` tags to all table elements for proper HTML structure
- Added `style="display: none;"` attributes to hidden rows for cleaner
display

---

## 3. API Test Links

### URL Updates
All test operation links now use absolute URLs instead of relative
paths:
- **Old**: `href="doc/test/[hash]"`
- **New**:
`href="https://ha101-1.overkiz.com/enduser-mobile-web/enduserAPI/doc/test/[hash]"`

### Affected Operations
Applied to all API operations that include test links:
- Create action group
- Update action group
- Delete action group
- Get action groups
- Execute action group
- And all other endpoints with test functionality

---

## 4. Access Scope Information

### New Access Scope Blocks
Added `<pre class="scoped">Access scope : ...</pre>` blocks to API
operations:
- Full enduser API access (enduser/*)
- Enduser Open API (enduser/o)
- Applied to all applicable API endpoints

### Example
```html
<pre class="scoped">Access scope : Full enduser API access (enduser/*)</pre>
```

---

## 5. Sample JSON and Default Values

### Action Group Examples

#### shortcut Field
- **Old**: `"shortcut" : false`
- **New**: `"shortcut" : true`

#### notificationCondition Field
- **Old**: `"notificationCondition" : "ALWAYS"`
- **New**: `"notificationCondition" : "ON_SUCCESS"`

#### New Field: lockLevel
- **Added**: `"lockLevel" : 5` to command parameters
- **Location**: Command examples within action groups

### Example Before:
```json
{
  "shortcut" : false,
  "notificationCondition" : "ALWAYS",
  "commands" : [ {
    "delay" : 1
  } ]
}
```

### Example After:
```json
{
  "shortcut" : true,
  "notificationCondition" : "ON_SUCCESS",
  "commands" : [ {
    "delay" : 1,
    "lockLevel" : 5
  } ]
}
```

---

## 6. Event Information Updates

### Event Descriptions and Reordering

#### GatewaySynchronizationStartedEvent
- **Added Fields**:
  - `"owningPartner" : "an owning partner"`
  - `"gatewayId" : "A gateway id (ex: 0101-1234-5678)"`

#### GatewaySynchronizationEndedEvent
- **Added Fields**:
  - `"owningPartner" : "an owning partner"`
  - `"gatewayId" : "A gateway id (ex: 0101-1234-5678)"`

#### ActionGroupCreatedEvent
- **Reordered**: Event appears later in documentation (moved after
GatewaySynchronizationStartedEvent)
- **Added Fields**:
  - `"owningPartners" : [ "some owning partners" ]`
- **Modified Structure**: Updated JSON example to reflect current API
response format

#### ActionGroupUpdatedEvent
- **New Event**: Added to documentation
- **Fields Include**:
  - `"owningPartners" : [ "some owning partners" ]`
  - Full action group structure with metadata

#### ActionGroupDeletedEvent
- **New Event**: Added to documentation
- **Fields Include**:
  - `"owningPartners" : [ "some owning partners" ]`
  - `"actionGroupOID"`
  - `"setupOID"`

#### ExecutionStateChangedEvent
- **Enhanced Fields**:
  - Added `"owningPartners" : [ "some owning partners" ]`
  - Added `"failedCommands"` array with detailed error information
  - Added `"failureTypeCode"` and `"failureType"` fields

#### DeviceStateChangedEvent
- **Enhanced Fields**:
  - Added `"owningPartners" : [ "some owning partners" ]`
  - Updated device state change structure

---

## 7. API Response Examples Updates

### Action Group Response Structure

#### Enhanced Fields
- **creationTime**: `"creationTime" : 1769503155441` (timestamp added)
- **lastUpdateTime**: `"lastUpdateTime" : 1769503155441` (timestamp
added)
- **lockLevel**: `"lockLevel" : 5` (now included in command examples)

### Execution Response Structure
- Updated to include complete execution details
- Added fields: `startTime`, `owner`, `actionGroup`, `description`,
`executionType`, `executionSubType`

---

## 8. Rate Limiting Information

### Updated Rate Limit Blocks
Rate limiting sections now include more detailed information:
- Per-session rate limits with specific time periods
- Categorized limits (e.g., "bulk-load", "exec")

### Example
```html
<pre class="rateLimited">Per-session rate-limit : 1 calls per 1d period for this particular operation (bulk-load)</pre>
```

---

## 9. Parameter Updates

### New Request Parameters
- **preventLockLevelReset**: Added to action group update operations
  - Type: Boolean (default false)
  - Description: "Do not reset command lock levels"

### Enhanced Parameter Descriptions
- Descriptions now wrapped in `<pre>` tags for consistency
- Added optional parameter indicators
- More detailed documentation of parameter purposes

---

## 10. Event Field Documentation

### New Event Fields Documented

#### owningPartner (singular)
- **Type**: String
- **Description**: "Owning partner of the parent entity (gateway, setup
group, ...)) . only available in event streams"
- **Applied to**: GatewaySynchronizationStartedEvent,
GatewaySynchronizationEndedEvent

#### owningPartners (plural)
- **Type**: Array of Strings
- **Description**: "Owning partners of the parent entity (setup, ...)) .
only available in event streams"
- **Applied to**: ActionGroupCreatedEvent, ActionGroupUpdatedEvent,
ActionGroupDeletedEvent, ExecutionStateChangedEvent,
DeviceStateChangedEvent

#### gatewayId
- **Type**: String
- **Description**: "A gateway id (ex: 0101-1234-5678)"
- **Applied to**: Gateway-related events

---

## 11. Content Organization Changes

### Event Reordering
Events are now organized in a different order within the documentation:
1. **Create Action Group Operation**:
   - GatewaySynchronizationStartedEvent (moved first)
   - ActionGroupCreatedEvent
   - GatewaySynchronizationEndedEvent

2. **Update Action Group Operation**:
   - GatewaySynchronizationStartedEvent
   - GatewaySynchronizationEndedEvent
   - ActionGroupUpdatedEvent

3. **Delete Action Group Operation**:
   - GatewaySynchronizationEndedEvent
   - GatewaySynchronizationStartedEvent
   - ActionGroupDeletedEvent

---

## 12. Trigger and Execution Documentation

### Delayed Execution Events
- Enhanced documentation for `DelayedTriggerSetEvent`
- Enhanced documentation for `DelayedTriggerCancelledEvent`
- Clearer execution type descriptions

### Weekly Planning
- Updated examples for weekly planning triggers
- Time-based trigger documentation
- Dawn/dusk trigger clarification

---

## 13. Country Data Updates

### New Country Support
- **Country**: South Korea
- **Code**: KR
- Added to all supported countries lists in location-related API
operations

---

## Summary of Changes

| Category | Change Type | Count |
|----------|------------|-------|
| Library Updates | Version upgrades | 2 |
| HTML Encoding | Entity encoding → literal | ~500+ |
| Self-closing Tags | Normalization | ~200+ |
| Test Links | URL updates | ~100+ |
| Access Scopes | Added blocks | ~50+ |
| Event Fields | New fields | 15+ |
| Event Events | New/reordered | 10+ |
| Sample Values | Updated defaults | 10+ |
| Parameters | New parameters | 5+ |
| Countries | New entries | 1+ |

---

## Impact Assessment

### For API Users
- ✅ Test links now direct to full absolute URLs
- ✅ Better documentation of event ownership and access scopes
- ✅ New fields provide more context (owningPartner/owningPartners)
- ✅ Enhanced error information in ExecutionStateChangedEvent

### For HTML/Browser Rendering
- ✅ Proper `<tbody>` tags improve semantic HTML
- ✅ Literal quote characters instead of entities improve readability
- ✅ Updated jQuery libraries (minified versions) improve performance

### For Backwards Compatibility
- ⚠️ New event fields should be treated as additions (not breaking)
- ⚠️ New parameter `preventLockLevelReset` is optional
- ⚠️ Sample JSON default values changed (may affect test/mock
implementations)

---

## Notes for Reviewers

When reviewing this file in GitHub:
1. **Use whitespace filtering**: Enable "Hide whitespace" in the diff
viewer
2. **Focus on**:
   - Event field additions and reordering
   - Sample JSON value changes
   - New access scope information
   - Test link URL updates
3. **Skip reviewing**: HTML entity encoding, self-closing tags, and
formatting changes (they don't affect functionality)

---

Generated: January 27, 2026
iMicknl added a commit that referenced this pull request Jan 31, 2026
# API Documentation Changelog

## Overview
This document details all changes made to `docs/api/index.html` in the
v2/apiDocs branch compared to v2/main.

---

## 1. Library and Resource Updates

### jQuery Library Versions
- **Old**: `jquery-1.10.2.js` and `jquery-1.10.2-ui.js`
- **New**: `jquery.min.js` and `jquery-ui.min.js`
- **Impact**: Updated to minified versions for better performance

### Stylesheet and Resource Links
- Normalized self-closing tags: `/>` → `>`
- Updated HTTP charset: `utf-8` → `windows-1252` (in meta tag)

---

## 2. HTML Formatting and Encoding Changes

### HTML Entity Encoding
All HTML entity-encoded quotes converted to literal quotes throughout
JSON examples:
- `&#34;` → `"`
- Applied consistently across all JSON sample values in the
documentation

### Self-Closing Tag Normalization
- `<br/>` → `<br>`
- `<link ... />` → `<link ... >`
- Applied to all HTML elements in the documentation

### Table Structure
- Added `<tbody>` tags to all table elements for proper HTML structure
- Added `style="display: none;"` attributes to hidden rows for cleaner
display

---

## 3. API Test Links

### URL Updates
All test operation links now use absolute URLs instead of relative
paths:
- **Old**: `href="doc/test/[hash]"`
- **New**:
`href="https://ha101-1.overkiz.com/enduser-mobile-web/enduserAPI/doc/test/[hash]"`

### Affected Operations
Applied to all API operations that include test links:
- Create action group
- Update action group
- Delete action group
- Get action groups
- Execute action group
- And all other endpoints with test functionality

---

## 4. Access Scope Information

### New Access Scope Blocks
Added `<pre class="scoped">Access scope : ...</pre>` blocks to API
operations:
- Full enduser API access (enduser/*)
- Enduser Open API (enduser/o)
- Applied to all applicable API endpoints

### Example
```html
<pre class="scoped">Access scope : Full enduser API access (enduser/*)</pre>
```

---

## 5. Sample JSON and Default Values

### Action Group Examples

#### shortcut Field
- **Old**: `"shortcut" : false`
- **New**: `"shortcut" : true`

#### notificationCondition Field
- **Old**: `"notificationCondition" : "ALWAYS"`
- **New**: `"notificationCondition" : "ON_SUCCESS"`

#### New Field: lockLevel
- **Added**: `"lockLevel" : 5` to command parameters
- **Location**: Command examples within action groups

### Example Before:
```json
{
  "shortcut" : false,
  "notificationCondition" : "ALWAYS",
  "commands" : [ {
    "delay" : 1
  } ]
}
```

### Example After:
```json
{
  "shortcut" : true,
  "notificationCondition" : "ON_SUCCESS",
  "commands" : [ {
    "delay" : 1,
    "lockLevel" : 5
  } ]
}
```

---

## 6. Event Information Updates

### Event Descriptions and Reordering

#### GatewaySynchronizationStartedEvent
- **Added Fields**:
  - `"owningPartner" : "an owning partner"`
  - `"gatewayId" : "A gateway id (ex: 0101-1234-5678)"`

#### GatewaySynchronizationEndedEvent
- **Added Fields**:
  - `"owningPartner" : "an owning partner"`
  - `"gatewayId" : "A gateway id (ex: 0101-1234-5678)"`

#### ActionGroupCreatedEvent
- **Reordered**: Event appears later in documentation (moved after
GatewaySynchronizationStartedEvent)
- **Added Fields**:
  - `"owningPartners" : [ "some owning partners" ]`
- **Modified Structure**: Updated JSON example to reflect current API
response format

#### ActionGroupUpdatedEvent
- **New Event**: Added to documentation
- **Fields Include**:
  - `"owningPartners" : [ "some owning partners" ]`
  - Full action group structure with metadata

#### ActionGroupDeletedEvent
- **New Event**: Added to documentation
- **Fields Include**:
  - `"owningPartners" : [ "some owning partners" ]`
  - `"actionGroupOID"`
  - `"setupOID"`

#### ExecutionStateChangedEvent
- **Enhanced Fields**:
  - Added `"owningPartners" : [ "some owning partners" ]`
  - Added `"failedCommands"` array with detailed error information
  - Added `"failureTypeCode"` and `"failureType"` fields

#### DeviceStateChangedEvent
- **Enhanced Fields**:
  - Added `"owningPartners" : [ "some owning partners" ]`
  - Updated device state change structure

---

## 7. API Response Examples Updates

### Action Group Response Structure

#### Enhanced Fields
- **creationTime**: `"creationTime" : 1769503155441` (timestamp added)
- **lastUpdateTime**: `"lastUpdateTime" : 1769503155441` (timestamp
added)
- **lockLevel**: `"lockLevel" : 5` (now included in command examples)

### Execution Response Structure
- Updated to include complete execution details
- Added fields: `startTime`, `owner`, `actionGroup`, `description`,
`executionType`, `executionSubType`

---

## 8. Rate Limiting Information

### Updated Rate Limit Blocks
Rate limiting sections now include more detailed information:
- Per-session rate limits with specific time periods
- Categorized limits (e.g., "bulk-load", "exec")

### Example
```html
<pre class="rateLimited">Per-session rate-limit : 1 calls per 1d period for this particular operation (bulk-load)</pre>
```

---

## 9. Parameter Updates

### New Request Parameters
- **preventLockLevelReset**: Added to action group update operations
  - Type: Boolean (default false)
  - Description: "Do not reset command lock levels"

### Enhanced Parameter Descriptions
- Descriptions now wrapped in `<pre>` tags for consistency
- Added optional parameter indicators
- More detailed documentation of parameter purposes

---

## 10. Event Field Documentation

### New Event Fields Documented

#### owningPartner (singular)
- **Type**: String
- **Description**: "Owning partner of the parent entity (gateway, setup
group, ...)) . only available in event streams"
- **Applied to**: GatewaySynchronizationStartedEvent,
GatewaySynchronizationEndedEvent

#### owningPartners (plural)
- **Type**: Array of Strings
- **Description**: "Owning partners of the parent entity (setup, ...)) .
only available in event streams"
- **Applied to**: ActionGroupCreatedEvent, ActionGroupUpdatedEvent,
ActionGroupDeletedEvent, ExecutionStateChangedEvent,
DeviceStateChangedEvent

#### gatewayId
- **Type**: String
- **Description**: "A gateway id (ex: 0101-1234-5678)"
- **Applied to**: Gateway-related events

---

## 11. Content Organization Changes

### Event Reordering
Events are now organized in a different order within the documentation:
1. **Create Action Group Operation**:
   - GatewaySynchronizationStartedEvent (moved first)
   - ActionGroupCreatedEvent
   - GatewaySynchronizationEndedEvent

2. **Update Action Group Operation**:
   - GatewaySynchronizationStartedEvent
   - GatewaySynchronizationEndedEvent
   - ActionGroupUpdatedEvent

3. **Delete Action Group Operation**:
   - GatewaySynchronizationEndedEvent
   - GatewaySynchronizationStartedEvent
   - ActionGroupDeletedEvent

---

## 12. Trigger and Execution Documentation

### Delayed Execution Events
- Enhanced documentation for `DelayedTriggerSetEvent`
- Enhanced documentation for `DelayedTriggerCancelledEvent`
- Clearer execution type descriptions

### Weekly Planning
- Updated examples for weekly planning triggers
- Time-based trigger documentation
- Dawn/dusk trigger clarification

---

## 13. Country Data Updates

### New Country Support
- **Country**: South Korea
- **Code**: KR
- Added to all supported countries lists in location-related API
operations

---

## Summary of Changes

| Category | Change Type | Count |
|----------|------------|-------|
| Library Updates | Version upgrades | 2 |
| HTML Encoding | Entity encoding → literal | ~500+ |
| Self-closing Tags | Normalization | ~200+ |
| Test Links | URL updates | ~100+ |
| Access Scopes | Added blocks | ~50+ |
| Event Fields | New fields | 15+ |
| Event Events | New/reordered | 10+ |
| Sample Values | Updated defaults | 10+ |
| Parameters | New parameters | 5+ |
| Countries | New entries | 1+ |

---

## Impact Assessment

### For API Users
- ✅ Test links now direct to full absolute URLs
- ✅ Better documentation of event ownership and access scopes
- ✅ New fields provide more context (owningPartner/owningPartners)
- ✅ Enhanced error information in ExecutionStateChangedEvent

### For HTML/Browser Rendering
- ✅ Proper `<tbody>` tags improve semantic HTML
- ✅ Literal quote characters instead of entities improve readability
- ✅ Updated jQuery libraries (minified versions) improve performance

### For Backwards Compatibility
- ⚠️ New event fields should be treated as additions (not breaking)
- ⚠️ New parameter `preventLockLevelReset` is optional
- ⚠️ Sample JSON default values changed (may affect test/mock
implementations)

---

## Notes for Reviewers

When reviewing this file in GitHub:
1. **Use whitespace filtering**: Enable "Hide whitespace" in the diff
viewer
2. **Focus on**:
   - Event field additions and reordering
   - Sample JSON value changes
   - New access scope information
   - Test link URL updates
3. **Skip reviewing**: HTML entity encoding, self-closing tags, and
formatting changes (they don't affect functionality)

---

Generated: January 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError: __init__() missing 1 required keyword-only argument: 'ui_class'

2 participants