Skip to content
This repository was archived by the owner on May 3, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All remarkable changes for this project will be documented here.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [SemVer](https://semver.org).

---
## [1.5.0] - 2025-10-22

### Fix
- There was a change in the StackSpot API response that caused the token count to break
- **NOTE**: I was contacted and informed that the fields are under review and that after that the documentation will be updated.

---
## [1.4.0] - 2025-09-17

Expand Down
10 changes: 6 additions & 4 deletions custom_components/stackspot/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,13 @@ async def _send_prompt_to_stackspot(self, prompt: str) -> str:

async def _actions_with_response(self, response: dict) -> None:
if "tokens" in response and isinstance(response["tokens"], dict):
user_tokens = response["tokens"].get("user", 0)
enrichment_tokens = response["tokens"].get("enrichment", 0)
output_tokens = response["tokens"].get("output", 0)
# TODO: Verificar quando o pessoal atualizar a documentação
user_tokens = response["tokens"].get("user") or 0
input_token = response["tokens"].get("input") or 0
enrichment_tokens = response["tokens"].get("enrichment") or 0
output_tokens = response["tokens"].get("output") or 0

await self._update_token_sensors(user_tokens, enrichment_tokens, output_tokens)
await self._update_token_sensors(user_tokens + input_token, enrichment_tokens, output_tokens)
else:
_LOGGER.debug("Resposta da StackSpot AI sem dados de tokens.")

Expand Down
2 changes: 1 addition & 1 deletion custom_components/stackspot/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/alves-dev/stackspot-homeassistant/issues",
"requirements": [],
"version": "1.4.0"
"version": "1.5.0"
}