Compare commits

...

8 Commits

Author SHA1 Message Date
90075b525b Fix hassfest issues
Some checks failed
Validate with hassfest / validate (push) Has been cancelled
Validate / validate-hacs (push) Has been cancelled
2026-05-17 21:32:16 -04:00
7598bb22ca add hassfest validation
Some checks failed
Validate with hassfest / validate (push) Has been cancelled
Validate / validate-hacs (push) Has been cancelled
2026-05-17 21:30:32 -04:00
cea8287084 Fix HACS validation
Some checks failed
Validate / validate-hacs (push) Has been cancelled
2026-05-17 21:25:13 -04:00
2f5756b1f6 add HACS action
Some checks failed
Validate / validate-hacs (push) Has been cancelled
2026-05-17 21:23:15 -04:00
d65a469d7f Add new connectivity checker 2026-05-17 20:11:30 -04:00
bf5ee44282 Update Jibo integration version to 0.1.0.3, add integration type, and ensure proper JSON structure. 2026-05-17 19:48:25 -04:00
b0019fe794 Enhance Jibo integration: Add service filtering by robot name, improve configuration flow, and update service documentation. 2026-05-17 19:42:32 -04:00
7efec4fa93 fix structure 2026-05-17 19:40:40 -04:00
12 changed files with 262 additions and 63 deletions

14
.github/workflows/hassfest.yml vendored Normal file
View File

@@ -0,0 +1,14 @@
name: Validate with hassfest
on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"
jobs:
validate:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- uses: home-assistant/actions/hassfest@master

16
.github/workflows/validate.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
name: Validate
on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
permissions: {}
jobs:
validate-hacs:
runs-on: "ubuntu-latest"
steps:
- name: HACS validation
uses: "hacs/action@main"
with:
category: "integration"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

View File

@@ -1,52 +1,99 @@
import asyncio
import aiohttp import aiohttp
import voluptuous as vol import voluptuous as vol
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant, ServiceCall
from homeassistant.helpers import config_validation as cv
import logging import logging
from .const import DOMAIN, PLATFORMS
CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN)
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
from .const import DOMAIN _SAY_SCHEMA = vol.Schema({
vol.Required("message"): str,
vol.Optional("robot"): str,
})
async def async_setup(hass: HomeAssistant, config: dict): async def async_setup(hass: HomeAssistant, config: dict):
"""Set up the Jibo integration.""" hass.data.setdefault(DOMAIN, {})
async def handle_say_service(call):
message = call.data.get("message")
ip = hass.data[DOMAIN]["jibo_ip"]
url = f"http://{ip}:8089/tts_speak"
payload = {
"prompt": message,
"locale": "en-us",
"voice": "griffin",
"duration_stretch": 1,
"pitch": 3,
"pitchBandwidth": 0.4,
"mode": "text",
"outputMode": "stream",
"timeout": None,
"volume": 0,
"whisper": "FALSE",
"samplerate": 48000,
"postfilter": 0.4,
"framerate": 240,
"unvoicedvoiced": 0.35,
"allPass": 0.76,
"gvMCEP": 0.9,
"cached": "TRUE"
}
async with aiohttp.ClientSession() as session:
try:
async with session.post(url, json=payload) as response:
if response.status != 200:
_LOGGER.error("Failed to speak: %s", await response.text())
except aiohttp.ClientError as e:
_LOGGER.error("Error communicating with Jibo: %s", e)
hass.services.async_register(DOMAIN, "say", handle_say_service)
return True return True
async def async_setup_entry(hass, entry):
"""Store IP from config flow.""" async def async_setup_entry(hass: HomeAssistant, entry):
hass.data[DOMAIN] = {"jibo_ip": entry.data["jibo_ip"]} hass.data.setdefault(DOMAIN, {})
return True hass.data[DOMAIN][entry.entry_id] = {
"jibo_ip": entry.data["jibo_ip"],
"name": entry.data.get("name", entry.title),
}
if not hass.services.has_service(DOMAIN, "say"):
async def handle_say(call: ServiceCall):
message = call.data["message"]
robot_filter = call.data.get("robot")
targets = [
data["jibo_ip"]
for data in hass.data[DOMAIN].values()
if robot_filter is None or data["name"] == robot_filter
]
if not targets:
_LOGGER.warning(
"No Jibo robot matched filter %r. Configured robots: %s",
robot_filter,
[d["name"] for d in hass.data[DOMAIN].values()],
)
return
payload = {
"prompt": message,
"locale": "en-us",
"voice": "griffin",
"duration_stretch": 1,
"pitch": 3,
"pitchBandwidth": 0.4,
"mode": "text",
"outputMode": "stream",
"timeout": None,
"volume": 0,
"whisper": "FALSE",
"samplerate": 48000,
"postfilter": 0.4,
"framerate": 240,
"unvoicedvoiced": 0.35,
"allPass": 0.76,
"gvMCEP": 0.9,
"cached": "TRUE",
}
async with aiohttp.ClientSession() as session:
for ip in targets:
url = f"http://{ip}:8089/tts_speak"
try:
async with session.post(url, json=payload) as response:
if response.status != 200:
_LOGGER.error(
"Jibo at %s returned %s: %s",
ip, response.status, await response.text(),
)
except aiohttp.ClientError as e:
_LOGGER.error("Error communicating with Jibo at %s: %s", ip, e)
hass.services.async_register(DOMAIN, "say", handle_say, schema=_SAY_SCHEMA)
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
return True
async def async_unload_entry(hass: HomeAssistant, entry):
unloaded = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
if unloaded:
hass.data[DOMAIN].pop(entry.entry_id, None)
if not hass.data[DOMAIN]:
hass.services.async_remove(DOMAIN, "say")
return unloaded

View File

@@ -0,0 +1,63 @@
import asyncio
import logging
from datetime import timedelta
from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
BinarySensorEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
SCAN_INTERVAL = timedelta(seconds=30)
_CONNECT_TIMEOUT = 5.0
_JIBO_PORT = 8089
async def async_setup_entry(
hass: HomeAssistant,
entry: ConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
data = hass.data[DOMAIN][entry.entry_id]
async_add_entities(
[JiboConnectivitySensor(entry, data["jibo_ip"], data["name"])],
update_before_add=True,
)
class JiboConnectivitySensor(BinarySensorEntity):
_attr_device_class = BinarySensorDeviceClass.CONNECTIVITY
_attr_should_poll = True
def __init__(self, entry: ConfigEntry, ip: str, name: str) -> None:
self._ip = ip
self._attr_unique_id = f"{entry.entry_id}_connectivity"
self._attr_name = f"{name} Online"
self._attr_is_on = False
self._attr_device_info = {
"identifiers": {(DOMAIN, entry.entry_id)},
"name": name,
"manufacturer": "Jibo Inc.",
"model": "Jibo",
}
async def async_update(self) -> None:
try:
_, writer = await asyncio.wait_for(
asyncio.open_connection(self._ip, _JIBO_PORT),
timeout=_CONNECT_TIMEOUT,
)
writer.close()
try:
await writer.wait_closed()
except Exception:
pass
self._attr_is_on = True
except (asyncio.TimeoutError, OSError):
self._attr_is_on = False

View File

@@ -1,17 +1,36 @@
import voluptuous as vol import voluptuous as vol
from homeassistant import config_entries from homeassistant import config_entries
from homeassistant.exceptions import HomeAssistantError
from .const import DOMAIN from .const import DOMAIN
class JiboConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): class JiboConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
VERSION = 1 VERSION = 1
CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_POLL
async def async_step_user(self, user_input=None): async def async_step_user(self, user_input=None):
errors = {}
if user_input is not None: if user_input is not None:
return self.async_create_entry(title="Jibo", data=user_input) ip = user_input["jibo_ip"].strip()
await self.async_set_unique_id(ip)
self._abort_if_unique_id_configured()
name = user_input.get("name", "").strip() or f"Jibo ({ip})"
return self.async_create_entry(
title=name,
data={"jibo_ip": ip, "name": name},
)
data_schema = vol.Schema({ data_schema = vol.Schema({
vol.Required("jibo_ip"): str vol.Required("name"): str,
vol.Required("jibo_ip"): str,
}) })
return self.async_show_form(step_id="user", data_schema=data_schema)
return self.async_show_form(
step_id="user",
data_schema=data_schema,
errors=errors,
)

View File

@@ -1 +1,2 @@
DOMAIN = "jibo" DOMAIN = "jibo"
PLATFORMS = ["binary_sensor"]

View File

@@ -1,10 +1,13 @@
{ {
"domain": "jibo", "domain": "jibo",
"name": "OpenJibo", "name": "OpenJibo",
"version": "0.1.0.a",
"documentation": "https://jibohacks.zane.org/homeassistant/int",
"requirements": [],
"dependencies": [],
"codeowners": ["@ZaneThePython"], "codeowners": ["@ZaneThePython"],
"config_flow": true "config_flow": true,
} "dependencies": [],
"documentation": "https://jibohacks.zane.org/homeassistant/int",
"integration_type": "device",
"iot_class": "local_polling",
"issue_tracker": "https://github.com/ZaneThePython/openjibo-hacs/issues",
"requirements": [],
"version": "0.1.0.4"
}

View File

@@ -1,7 +1,17 @@
say: say:
description: Make Jibo Say Something description: Make a Jibo robot say something.
fields: fields:
message: message:
description: Text to speak description: The text to speak.
example: "Hello Home Assistant" example: "Hello, Home Assistant!"
required: true required: true
selector:
text:
robot:
description: >
Name of the robot to speak on. Leave empty to speak on all configured
Jibo robots.
example: "Living Room Jibo"
required: false
selector:
text:

View File

@@ -0,0 +1,28 @@
{
"config": {
"step": {
"user": {
"title": "Add a Jibo Robot",
"description": "Enter the details for your Jibo robot. The robot must be running the OpenJibo custom software with all ports exposed.",
"data": {
"name": "Robot Name",
"jibo_ip": "IP Address"
},
"data_description": {
"name": "A friendly name to identify this robot (e.g. Living Room Jibo).",
"jibo_ip": "The local IP address of the robot on your network."
}
}
},
"abort": {
"already_configured": "A Jibo robot with this IP address is already configured."
}
},
"entity": {
"binary_sensor": {
"connectivity": {
"name": "Online"
}
}
}
}

View File

@@ -1,6 +1,4 @@
{ {
"name": "OpenJibo", "name": "OpenJibo",
"render_markdown": true, "homeassistant": "2026.5.2"
"homeassistant": "2026.5.2" }
}