Skip to content

Commit c91ae93

Browse files
committed
ci: Change from black/isort to ruff
1 parent 3bb3648 commit c91ae93

File tree

3 files changed

+100
-113
lines changed

3 files changed

+100
-113
lines changed

.github/workflows/lint.yaml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,10 @@ on:
1313
- "**.py"
1414

1515
jobs:
16-
lint-black:
16+
lint-ruff:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v3
20-
- uses: psf/black@stable
19+
- uses: actions/checkout@v4
20+
- uses: astral-sh/ruff-action@v1
2121
with:
22-
options: ". --check --color --diff"
23-
lint-isort:
24-
runs-on: ubuntu-latest
25-
steps:
26-
- uses: actions/checkout@v3
27-
- uses: isort/isort-action@master
28-
with:
29-
configuration: "--check-only --diff --profile black"
22+
args: "--check --fix --exit-zero"

README.md

Lines changed: 93 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# baby_buddy_homeassistant
22

33
[![hacs_badge](https://img.shields.io/badge/HACS-Default-orange.svg)](https://github.com/custom-components/hacs)
4-
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
5-
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
4+
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
65

76
This custom integration allows you to monitor [Baby Buddy](https://github.com/babybuddy/babybuddy) data for your child within [Home Assistant](https://github.com/home-assistant/core). It also allows you to start timers and add data entries from within Home Assistant.
87

@@ -22,12 +21,12 @@ Adding BabyBuddy to your Home Assistant instance can be done via the user interf
2221

2322
### Parameters
2423

25-
| Name | Optional | Description |
26-
|------|:----:|-------------|
27-
| address | no | Host URL for your instance of Baby Buddy, without sub path
28-
| port | no | Host port (default = 8000)
29-
| path | no | Sub path of your Baby Buddy instance (default = "")
30-
| api_key| no | The API key from the user settings page on your instance of Baby Buddy
24+
| Name | Optional | Description |
25+
| ------- | :------: | ---------------------------------------------------------------------- |
26+
| address | no | Host URL for your instance of Baby Buddy, without sub path |
27+
| port | no | Host port (default = 8000) |
28+
| path | no | Sub path of your Baby Buddy instance (default = "") |
29+
| api_key | no | The API key from the user settings page on your instance of Baby Buddy |
3130

3231
### Options
3332

@@ -65,154 +64,154 @@ This integration provides the following entities.
6564

6665
This service adds a new child. At least one child should be added to start seeing the different sensors and switches.
6766

68-
| Service data attribute | Optional | Description |
69-
|------|:----:|-------------|
70-
| first_name | no | Baby's first name
71-
| last_name | no | Baby's last name
72-
| birth_date | no | Child's birth date in YYYY-MM-DD format
67+
| Service data attribute | Optional | Description |
68+
| ---------------------- | :------: | --------------------------------------- |
69+
| first_name | no | Baby's first name |
70+
| last_name | no | Baby's last name |
71+
| birth_date | no | Child's birth date in YYYY-MM-DD format |
7372

7473
### SERVICE ADD_BMI
7574

7675
This service adds a BMI entry for your child.
7776

78-
| Service data attribute | Optional | Description |
79-
|------|:----:|-------------|
80-
| entity_id | no | entity_id for the child sensor
81-
| BMI | no | Specify BMI value (float)
82-
| date | yes | Specify BMI recording date (YYYY-MM-DD format, else today() will be used)
83-
| notes | yes | Add notes text to entry
77+
| Service data attribute | Optional | Description |
78+
| ---------------------- | :------: | ------------------------------------------------------------------------- |
79+
| entity_id | no | entity_id for the child sensor |
80+
| BMI | no | Specify BMI value (float) |
81+
| date | yes | Specify BMI recording date (YYYY-MM-DD format, else today() will be used) |
82+
| notes | yes | Add notes text to entry |
8483

8584
### SERVICE ADD_DIAPER_CHANGE
8685

8786
This service adds a diaper change entry for your child.
8887

89-
| Service data attribute | Optional | Description |
90-
|------|:----:|-------------|
91-
| entity_id | no | entity_id for the child sensor
92-
| type | yes | Specify type of diaper. This can be `Wet`, `Solid`, or `Wet and Solid`.
93-
| time | yes | Specify diaper change time (must be in the past, else now() will be used)
94-
| color | yes | Specify diaper color. This can be `Black`, `Brown` , `Green`, or `Yellow`.
95-
| amount | yes | Add number of diapers
96-
| notes | yes | Add notes text to entry
88+
| Service data attribute | Optional | Description |
89+
| ---------------------- | :------: | -------------------------------------------------------------------------- |
90+
| entity_id | no | entity_id for the child sensor |
91+
| type | yes | Specify type of diaper. This can be `Wet`, `Solid`, or `Wet and Solid`. |
92+
| time | yes | Specify diaper change time (must be in the past, else now() will be used) |
93+
| color | yes | Specify diaper color. This can be `Black`, `Brown` , `Green`, or `Yellow`. |
94+
| amount | yes | Add number of diapers |
95+
| notes | yes | Add notes text to entry |
9796

9897
### SERVICE ADD_FEEDING
9998

10099
This service adds a feeding entry for your child. Feeding start/end/child fields can be linked to an active timer.
101100

102-
| Service data attribute | Optional | Description |
103-
|------|:----:|-------------|
104-
| entity_id | no | entity_id for the timer switch linked to the child.
105-
| type | no | Specify type of feeding. Can be one of `Breast milk`, `Formula`, `Fortified breast milk`, or `Solid food`.
106-
| method | no | Specify method of feeding. Can be one of `Bottle`, `Left breast`, `Right breast`, `Both breasts`, `Self fed`, or `Parent fed`.
107-
| timer | yes | Set to True to use the currently active timer
108-
| start | yes | Specify start time (must be in the past, else now() will be used). This can be ignored if timer is used.
109-
| end | yes | Specify end time (must be in the past, else now() will be used). This can be ignored if timer is used.
110-
| amount | yes | Specify amount of feeding as an integer
111-
| notes | yes | Add notes text to entry
101+
| Service data attribute | Optional | Description |
102+
| ---------------------- | :------: | ------------------------------------------------------------------------------------------------------------------------------ |
103+
| entity_id | no | entity_id for the timer switch linked to the child. |
104+
| type | no | Specify type of feeding. Can be one of `Breast milk`, `Formula`, `Fortified breast milk`, or `Solid food`. |
105+
| method | no | Specify method of feeding. Can be one of `Bottle`, `Left breast`, `Right breast`, `Both breasts`, `Self fed`, or `Parent fed`. |
106+
| timer | yes | Set to True to use the currently active timer |
107+
| start | yes | Specify start time (must be in the past, else now() will be used). This can be ignored if timer is used. |
108+
| end | yes | Specify end time (must be in the past, else now() will be used). This can be ignored if timer is used. |
109+
| amount | yes | Specify amount of feeding as an integer |
110+
| notes | yes | Add notes text to entry |
112111

113112
### SERVICE ADD_HEAD_CIRCUMFERENCE
114113

115114
This service adds a head circumference entry for your child.
116115

117-
| Service data attribute | Optional | Description |
118-
|------|:----:|-------------|
119-
| entity_id | no | entity_id for the child sensor
120-
| head_circumference | no | Specify head circumference value (float)
121-
| date | yes | Specify head circumference recording date (YYYY-MM-DD format, else today() will be used)
122-
| notes | yes | Add notes text to entry
116+
| Service data attribute | Optional | Description |
117+
| ---------------------- | :------: | ---------------------------------------------------------------------------------------- |
118+
| entity_id | no | entity_id for the child sensor |
119+
| head_circumference | no | Specify head circumference value (float) |
120+
| date | yes | Specify head circumference recording date (YYYY-MM-DD format, else today() will be used) |
121+
| notes | yes | Add notes text to entry |
123122

124123
### SERVICE ADD_HEIGHT
125124

126125
This service adds a height entry for your child.
127126

128-
| Service data attribute | Optional | Description |
129-
|------|:----:|-------------|
130-
| entity_id | no | entity_id for the child sensor
131-
| height | no | Specify height value (float)
132-
| date | yes | Specify height recording date (YYYY-MM-DD format, else today() will be used)
133-
| notes | yes | Add notes text to entry
127+
| Service data attribute | Optional | Description |
128+
| ---------------------- | :------: | ---------------------------------------------------------------------------- |
129+
| entity_id | no | entity_id for the child sensor |
130+
| height | no | Specify height value (float) |
131+
| date | yes | Specify height recording date (YYYY-MM-DD format, else today() will be used) |
132+
| notes | yes | Add notes text to entry |
134133

135134
### SERVICE ADD_NOTE
136135

137136
This service adds a note entry for your child.
138137

139-
| Service data attribute | Optional | Description |
140-
|------|:----:|-------------|
141-
| entity_id | no | entity_id for the child sensor
142-
| notes | yes | Add notes text to entry
143-
| time | yes | Specify notes recording time (must be in the past, else now() will be used)
138+
| Service data attribute | Optional | Description |
139+
| ---------------------- | :------: | --------------------------------------------------------------------------- |
140+
| entity_id | no | entity_id for the child sensor |
141+
| notes | yes | Add notes text to entry |
142+
| time | yes | Specify notes recording time (must be in the past, else now() will be used) |
144143

145144
### SERVICE ADD_PUMPING
146145

147146
This service adds a pumping entry for your child.
148147

149-
| Service data attribute | Optional | Description |
150-
|------|:----:|-------------|
151-
| entity_id | no | entity_id for the child sensor
152-
| amount | no | Specify amount of pumping as an integer
153-
| time | yes | Specify pumping recording time (must be in the past, else now() will be used)
154-
| notes | yes | Add notes text to entry
148+
| Service data attribute | Optional | Description |
149+
| ---------------------- | :------: | ----------------------------------------------------------------------------- |
150+
| entity_id | no | entity_id for the child sensor |
151+
| amount | no | Specify amount of pumping as an integer |
152+
| time | yes | Specify pumping recording time (must be in the past, else now() will be used) |
153+
| notes | yes | Add notes text to entry |
155154

156155
### SERVICE ADD_SLEEP
157156

158157
This service adds a sleep entry for your child. Sleep start/end/child fields can be linked to an active timer.
159158

160-
| Service data attribute | Optional | Description |
161-
|------|:----:|-------------|
162-
| entity_id | no | entity_id for the timer switch linked to the child
163-
| timer | yes | Set to True to use the currently active timer
164-
| start | yes | Specify start time (must be in the past, else now() will be used). This can be ignored if timer is used.
165-
| end | yes | Specify end time (must be in the past, else now() will be used). This can be ignored if timer is used.
166-
| notes | yes | Add notes text to entry
159+
| Service data attribute | Optional | Description |
160+
| ---------------------- | :------: | -------------------------------------------------------------------------------------------------------- |
161+
| entity_id | no | entity_id for the timer switch linked to the child |
162+
| timer | yes | Set to True to use the currently active timer |
163+
| start | yes | Specify start time (must be in the past, else now() will be used). This can be ignored if timer is used. |
164+
| end | yes | Specify end time (must be in the past, else now() will be used). This can be ignored if timer is used. |
165+
| notes | yes | Add notes text to entry |
167166

168167
### SERVICE ADD_TEMPERATURE
169168

170169
This service adds a temperature entry for your child.
171170

172-
| Service data attribute | Optional | Description |
173-
|------|:----:|-------------|
174-
| entity_id | no | entity_id for the child sensor
175-
| temperature | no | Specify temperature value (float)
176-
| time | yes | Specify temperature recording time (must be in the past, else now() will be used)
177-
| notes | yes | Add notes text to entry
171+
| Service data attribute | Optional | Description |
172+
| ---------------------- | :------: | --------------------------------------------------------------------------------- |
173+
| entity_id | no | entity_id for the child sensor |
174+
| temperature | no | Specify temperature value (float) |
175+
| time | yes | Specify temperature recording time (must be in the past, else now() will be used) |
176+
| notes | yes | Add notes text to entry |
178177

179178
### SERVICE ADD_TUMMY_TIME
180179

181180
This service adds a tummy time entry for your child. Tummy time start/end/child fields can be linked to an active timer.
182181

183-
| Service data attribute | Optional | Description |
184-
|------|:----:|-------------|
185-
| entity_id | no | entity_id for the timer switch linked to the child
186-
| timer | yes | Set to True to use the currently active timer
187-
| start | yes | Specify start time (must be in the past, else now() will be used). This can be ignored if timer is used.
188-
| end | yes | Specify end time (must be in the past, else now() will be used). This can be ignored if timer is used.
189-
| milestone | yes | Add milestone text to entry
182+
| Service data attribute | Optional | Description |
183+
| ---------------------- | :------: | -------------------------------------------------------------------------------------------------------- |
184+
| entity_id | no | entity_id for the timer switch linked to the child |
185+
| timer | yes | Set to True to use the currently active timer |
186+
| start | yes | Specify start time (must be in the past, else now() will be used). This can be ignored if timer is used. |
187+
| end | yes | Specify end time (must be in the past, else now() will be used). This can be ignored if timer is used. |
188+
| milestone | yes | Add milestone text to entry |
190189

191190
### SERVICE ADD_WEIGHT
192191

193192
This service adds a weight entry for your child.
194193

195-
| Service data attribute | Optional | Description |
196-
|------|:----:|-------------|
197-
| entity_id | no | entity_id for the child sensor
198-
| weight | no | Specify weight value (float)
199-
| date | yes | Specify weight recording date (YYYY-MM-DD format, else today() will be used)
200-
| notes | yes | Add notes text to entry
194+
| Service data attribute | Optional | Description |
195+
| ---------------------- | :------: | ---------------------------------------------------------------------------- |
196+
| entity_id | no | entity_id for the child sensor |
197+
| weight | no | Specify weight value (float) |
198+
| date | yes | Specify weight recording date (YYYY-MM-DD format, else today() will be used) |
199+
| notes | yes | Add notes text to entry |
201200

202201
### SERVICE DELETE_LAST_ENTRY
203202

204203
This service will delete the last entry for specified child.
205204

206-
| Service data attribute | Optional | Description |
207-
|------|:----:|-------------|
208-
| entity_id | no | entity_id for the child who's last entry will be deleted
205+
| Service data attribute | Optional | Description |
206+
| ---------------------- | :------: | -------------------------------------------------------- |
207+
| entity_id | no | entity_id for the child who's last entry will be deleted |
209208

210209
### SERVICE START_TIMER
211210

212211
This service starts a new timer for specified child with optional starting time.
213212

214-
| Service data attribute | Optional | Description |
215-
|------|:----:|-------------|
216-
| entity_id | no | entity_id for the switch linked to the child
217-
| start | yes | Specify start time (must be in the past, else now() will be used)
218-
| name | yes | Optional name for new timer
213+
| Service data attribute | Optional | Description |
214+
| ---------------------- | :------: | ----------------------------------------------------------------- |
215+
| entity_id | no | entity_id for the switch linked to the child |
216+
| start | yes | Specify start time (must be in the past, else now() will be used) |
217+
| name | yes | Optional name for new timer |

0 commit comments

Comments
 (0)