diff --git a/.devcontainer/configuration.yaml b/.devcontainer/configuration.yaml index 246b33b..124d0e4 100644 --- a/.devcontainer/configuration.yaml +++ b/.devcontainer/configuration.yaml @@ -45,6 +45,12 @@ sensor: unit_of_measurement: 's' value_template: '{{ as_timestamp(now()) }}' + - platform: rest + name: counter_no_significant_update + resource: https://jsonplaceholder.typicode.com/posts/1 + value_template: '{{ value_json.id | int }}' + force_update: true + input_boolean: test_boolean: name: Test Input Boolean @@ -57,4 +63,14 @@ automation: action: - service: homeassistant.update_entity target: - entity_id: sensor.counter + entity_id: + - sensor.counter + - alias: 'Update counter 2' + trigger: + - platform: time_pattern + seconds: '/10' + action: + - service: homeassistant.update_entity + target: + entity_id: + - sensor.counter_no_significant_update diff --git a/.devcontainer/ui-lovelace.yaml b/.devcontainer/ui-lovelace.yaml index aeb0738..fd5a1c3 100644 --- a/.devcontainer/ui-lovelace.yaml +++ b/.devcontainer/ui-lovelace.yaml @@ -962,3 +962,11 @@ views: group_by: func: diff duration: 10s + + - type: custom:apexcharts-card + header: + show: true + title: Significant Updates + graph_span: 1m + series: + - entity: sensor.counter_no_significant_update diff --git a/src/graphEntry.ts b/src/graphEntry.ts index 43aec75..9d1ae10 100644 --- a/src/graphEntry.ts +++ b/src/graphEntry.ts @@ -213,7 +213,6 @@ export default class GraphEntry { : new Date(startHistory.getTime() + (this._config.group_by.func !== 'raw' ? 0 : -1)), end, this._config.attribute || this._config.transform ? false : skipInitialState, - this._config.attribute || this._config.transform ? true : false, ); if (newHistory && newHistory[0] && newHistory[0].length > 0) { /* @@ -311,15 +310,13 @@ export default class GraphEntry { start: Date | undefined, end: Date | undefined, skipInitialState: boolean, - withAttributes = false, ): Promise { let url = 'history/period'; if (start) url += `/${start.toISOString()}`; url += `?filter_entity_id=${this._entityID}`; if (end) url += `&end_time=${end.toISOString()}`; if (skipInitialState) url += '&skip_initial_state'; - if (!withAttributes) url += '&minimal_response'; - if (withAttributes) url += '&significant_changes_only=0'; + url += '&significant_changes_only=0'; return this._hass?.callApi('GET', url); }