Skip to content

Commit 2229d6c

Browse files
authored
Merge pull request #104 from CM000n/Update_questdb_client_to_2.0.4
Update questdb client to 2.0.4
2 parents 2d75047 + 9dcc3b3 commit 2229d6c

File tree

6 files changed

+565
-560
lines changed

6 files changed

+565
-560
lines changed

custom_components/qss/__init__.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
vol.Required(CONF_AUTH_D_KEY, default=""): cv.string,
5151
vol.Required(CONF_AUTH_X_KEY, default=""): cv.string,
5252
vol.Required(CONF_AUTH_Y_KEY, default=""): cv.string,
53-
},
53+
}
5454
)
5555

5656

@@ -61,8 +61,8 @@
6161
vol.Required(CONF_HOST): cv.string,
6262
vol.Required(CONF_PORT): cv.positive_int,
6363
vol.Optional(CONF_AUTH, default={}): AUTHENTICATION_SCHEMA,
64-
},
65-
),
64+
}
65+
)
6666
},
6767
extra=vol.ALLOW_EXTRA,
6868
)
@@ -85,11 +85,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
8585
db_auth = (auth_kid, auth_d_key, auth_x_key, auth_y_key, auth_ssl_check)
8686

8787
instance = QuestDB(
88-
hass=hass,
89-
host=db_host,
90-
port=db_port,
91-
entity_filter=entity_filter,
92-
auth=db_auth,
88+
hass=hass, host=db_host, port=db_port, entity_filter=entity_filter, auth=db_auth
9389
)
9490
instance.async_initialize()
9591
instance.start()
@@ -154,8 +150,7 @@ def notify_hass_started(event: Event) -> None: # noqa: ARG001
154150
hass_started.set_result(None)
155151

156152
self.hass.bus.async_listen_once(
157-
EVENT_HOMEASSISTANT_START,
158-
notify_hass_started,
153+
EVENT_HOMEASSISTANT_START, notify_hass_started
159154
)
160155

161156
self.hass.add_job(register)
@@ -168,11 +163,7 @@ def notify_hass_started(event: Event) -> None: # noqa: ARG001
168163
event = get_event_from_queue(self.queue)
169164
finish_task_if_empty_event(event, self.queue)
170165
insert_event_data_into_questdb(
171-
self.host,
172-
self.port,
173-
self.auth,
174-
event,
175-
self.queue,
166+
self.host, self.port, self.auth, event, self.queue
176167
)
177168

178169
@callback

custom_components/qss/event_handling.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@
88

99

1010
def put_event_to_queue(
11-
event: Event,
12-
entity_filter: Callable[[str], bool],
13-
queue: Queue,
11+
event: Event, entity_filter: Callable[[str], bool], queue: Queue
1412
) -> None:
1513
"""Get events with new states and put them in the process queue."""
1614
entity_id = event.data.get(ATTR_ENTITY_ID)
1715
state = event.data.get("new_state")
1816
if state is not None and all(
19-
[entity_id, state, state.state != STATE_UNKNOWN, entity_filter(entity_id)],
17+
[entity_id, state, state.state != STATE_UNKNOWN, entity_filter(entity_id)]
2018
):
2119
queue.put(event)
2220

custom_components/qss/io.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ def _insert_row_with_auth(host: str, port: int, auth: tuple, event: Event) -> No
2929
attrs = dict(state.attributes)
3030
sender.row(
3131
"qss",
32-
symbols={
33-
"entity_id": entity_id,
34-
},
32+
symbols={"entity_id": entity_id},
3533
columns={
3634
"state": state.state,
3735
"attributes": dumps(attrs, sort_keys=True, default=str),
@@ -49,9 +47,7 @@ def _insert_row_without_auth(host: str, port: int, event: Event) -> None:
4947
attrs = dict(state.attributes)
5048
sender.row(
5149
"qss",
52-
symbols={
53-
"entity_id": entity_id,
54-
},
50+
symbols={"entity_id": entity_id},
5551
columns={
5652
"state": state.state,
5753
"attributes": dumps(attrs, sort_keys=True, default=str),

custom_components/qss/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
"documentation": "https://github.com/CM000n/QSS",
77
"iot_class": "local_push",
88
"issue_tracker": "https://github.com/CM000n/QSS/issues",
9-
"requirements": ["questdb>=2.0.3", "tenacity>=8.0"],
10-
"version": "v0.0.15"
9+
"requirements": ["questdb>=2.0.4", "tenacity>=9.0"],
10+
"version": "v0.0.16"
1111
}

0 commit comments

Comments
 (0)