Skip to content

Commit

Permalink
add README of energy
Browse files Browse the repository at this point in the history
  • Loading branch information
jekalmin committed Feb 21, 2024
1 parent 5323211 commit 690125d
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 31 deletions.
31 changes: 0 additions & 31 deletions examples/function/calendar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,37 +33,6 @@
response_variable: _function_result
```
### 1. get_events
```yaml
- spec:
name: get_events
description: Use this function to get list of calendar events.
parameters:
type: object
properties:
start_date_time:
type: string
description: The start date time in '%Y-%m-%dT%H:%M:%S%z' format
end_date_time:
type: string
description: The end date time in '%Y-%m-%dT%H:%M:%S%z' format
required:
- start_date_time
- end_date_time
function:
type: script
sequence:
- service: calendar.get_events
data:
start_date_time: "{{start_date_time}}"
end_date_time: "{{end_date_time}}"
target:
entity_id:
- calendar.[YourCalendarHere]
- calendar.[MoreCalendarsArePossible]
response_variable: _function_result
```
### 2. create_event
```yaml
- spec:
Expand Down
63 changes: 63 additions & 0 deletions examples/function/energy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
## Objective
- Get energy statistics

<img width="300" src="https://github.com/jekalmin/extended_openai_conversation/assets/2917984/04ef6eaa-f0be-4cf2-ae53-b11aecf88c4d">
<img width="300" src="https://github.com/jekalmin/extended_openai_conversation/assets/2917984/a38e88e2-c5e5-4db9-a7d3-b3ee2cecb8c2">

## Function

### get_energy_statistic_ids
```yaml
- spec:
name: get_energy_statistic_ids
description: Get statistics
parameters:
type: object
properties:
dummy:
type: string
description: Nothing
function:
type: composite
sequence:
- type: native
name: get_energy
response_variable: result
- type: template
value_template: "{{result.device_consumption | map(attribute='stat_consumption') | list}}"
```
### get_statistics
```yaml
- spec:
name: get_statistics
description: Get statistics
parameters:
type: object
properties:
start_time:
type: string
description: The start datetime
end_time:
type: string
description: The end datetime
statistic_ids:
type: array
items:
type: string
description: The statistic ids
period:
type: string
description: The period
enum:
- day
- week
- month
required:
- start_time
- end_time
- statistic_ids
- period
function:
type: native
name: get_statistics
```

0 comments on commit 690125d

Please sign in to comment.