Compare commits

..

6 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
8 changed files with 146 additions and 17 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"

View File

@@ -1,9 +1,12 @@
import aiohttp
import voluptuous as vol
from homeassistant.core import HomeAssistant, ServiceCall
from homeassistant.helpers import config_validation as cv
import logging
from .const import DOMAIN
from .const import DOMAIN, PLATFORMS
CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN)
_LOGGER = logging.getLogger(__name__)
@@ -80,13 +83,17 @@ async def async_setup_entry(hass: HomeAssistant, entry):
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 True
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 +1,2 @@
DOMAIN = "jibo"
PLATFORMS = ["binary_sensor"]

View File

@@ -1,11 +1,13 @@
{
"domain": "jibo",
"name": "OpenJibo",
"version": "0.1.0.alpha.2",
"documentation": "https://jibohacks.zane.org/homeassistant/int",
"requirements": [],
"dependencies": [],
"codeowners": ["@ZaneThePython"],
"config_flow": true,
"iot_class": "local_polling"
"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

@@ -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",
"render_markdown": true,
"homeassistant": "2026.5.2"
}
}