Repository navigation
v3.2.0
This release expands the integration beyond Hisense-badged hardware to provide comprehensive, end-to-end support for all partner TV brands operating on the VIDAA Smart TV platform (including Toshiba, Loewe, TPV Technology / Philips, Schneider, Akai, Beko, and others). It also introduces robust client SSL certificate semantic and syntactic validation, enriched async UPnP descriptor parsing, and graceful Zeroconf / HomeKit metadata extraction.
☕ Support the Project
If this integration has added value to your smart home setup, consider buying me a coffee to support continued development and maintenance:
🌟 What's New & Hardened in v3.2.0
- UNIVERSAL VIDAA OEM MULTI-BRAND SUPPORT:
- Full cryptographic and lifecycle support for all licensed partner TV brands running VIDAA OS: Hisense (
his), Toshiba (tos), Loewe / We. by Loewe (loe), TPV Technology / Philips / AOC (tpv), Sharp (shp), JVC (jvc), Schneider (sch), Akai (aka), Beko (bek), Telefunken (tel), Bush (bus), Vizio (vic), Philco (phi), Noblex (nob), Sansei (san), RCA (rca), Sinotec (sin), Vestel (ves), Brandt (bra), Metz (met), and Leica (lei). - Post-PIN Brand Overwrite Prevention (
flow_helpers.py,config_flow.py): Fixed a critical bug where post-PIN device discovery defaulted to"his"and unconditionally clobbered a cascade- or cert-hinted OEM brand (tos,loe,tpv,shp,jvc) when UPnP was blocked across isolated VLANs or omittedbrand=. - Dynamic Client Credential Regeneration on Brand Change (
client.py,__init__.py): Changing the TV OEM brand in Options Flow or setup now automatically derives fresh brand-scoped pairing credentials (client_id,username,password) and invalidates stale tokens onHisenseTvClient, persisting the new credentials cleanly toentry.data. - Expanded Candidate OEM Brand Handshake Cascade (
protocol/pairing.py): When pairing over manual IP or isolated IoT VLANs without UPnP discovery, if the broker rejects the initial connection withrc: 5(Not Authorized), the pairing engine automatically cascades through high-probability candidate brands (tos,loe,tpv,shp,jvc), auto-adopting the accepted brand and updating the Home Assistant device registry. - Automatic OEM Brand Detection from Certificate Filenames (
protocol/certs.py): Addeddetect_brand_from_cert_paths(). Placing brand-named certificates in/config/ssl/(e.g.toshiba.crt,loewe.pem,philips.crt,sharp.pem,jvc.key,rcamobile.p12) automatically hints the TV manufacturer and pre-configures the dynamic OEM salt. - Manual IP Setup & Device Options Brand Selectors (
config_flow.py,options_flow.py): AddedCONF_BRANDselector dropdown to both the initial manual IP setup step and the Security Options menu, allowing users to explicitly select their TV OEM brand upfront or adjust it later. - Canonical Brand Normalization & 3-Letter Code Preservation (
discovery.py): Updatednormalize_brand_code()to tokenize word boundaries, avoiding false substring collisions (e.g. preventing"unrecognized_brand"from matching"bra"Brandt), while preserving explicit 3-letter alphanumeric codes (brand=xyz) from UPnP<modelDescription>. - UPnP Descriptor MAC Fallbacks (
tv/upnp_desc.py,protocol/upnp.py): Supportedmacandnetwork_deviceas fallback MAC keys in UPnP XML descriptors alongsidemacWifi. - Brand-Aware Diagnostics & Sensor Fallbacks (
sensors_diagnostic.py,tv/probe.py,client.py): Diagnostic sensors, default friendly names, and probe Markdown reports now dynamically reflect the resolved TV OEM brand rather than hardcoding"Hisense". - CLI Diagnostics Multi-Brand Support: Added
--brandparameter totest_client.pyanddebug_tv.pywith open brand support.
- Full cryptographic and lifecycle support for all licensed partner TV brands running VIDAA OS: Hisense (
- TOPTRO SMART PROJECTOR SUPPORT & OEM BRAND PROPAGATION (
const.py,discovery.py,protocol/auth.py,protocol/pairing.py,client.py):- Added official OEM brand support for TOPTRO portable smart projectors running VIDAA OS (e.g. FreeStyle series), mapping
tpoandtoptroacrossBRAND_OPTIONS,BRAND_MAP, andBRAND_CODE_MAP. - Expanded the pairing cascade fallback candidate list to automatically probe
tpoalongsidetos,loe,tpv,shp, andjvcwhen initial connections to projector brokers fail. - Enhanced
async_probe_tv_auth_methods()andHisenseTvClient.async_probe_auth_methods()to propagate synchronized device clock timestamps (timestamp=int(time.time()) + self.clock_offset) and active OEM brand prefixes. - Hardened MQTT diagnostic classification across both MQTT 3.1.1 (
rc: 4,rc: 5) and MQTT 5.0 (rc: 134,rc: 135) usingAUTH_REJECTION_CODES, ensuring bad credentials and permission rejections are cleanly reported as"not_authorized"rather than generic network connection errors. - Dynamic brand refresh in pairing handshake: auto-detects and updates
client.brandfrom UPnP descriptor fingerprints before pairing ifclient.brandis still at default ("his"), safeguarding manual brand overrides.
- Added official OEM brand support for TOPTRO portable smart projectors running VIDAA OS (e.g. FreeStyle series), mapping
- "AUTO-DETECT" BRAND OPTION & DEDICATED BRAND PROFILE DIAGNOSTIC SENSOR (
const.py,config_flow.py,sensor.py,sensors_diagnostic.py,flow_helpers.py,flow_reauth.py,options_flow.py,translations/*.json):- Added
"auto": "Auto Detect (Recommended)"as the default option in the setup and options brand selectors (BRAND_OPTIONS,DEFAULT_BRAND_OPTION), matching the authentication profile UX. - Streamlined manual setup: users only need to type their TV/projector IP address; the integration queries the UPnP descriptor on port 38400, extracts
brand=...from<modelDescription>, normalizes the code, and resolves OEM branding with zero manual intervention. - Added a dedicated diagnostic entity:
HisenseVidaaBrandProfileSensor(sensor.<device>_brand_profile), displaying the configured brand profile (Auto Detect (Recommended),Hisense,Toshiba,TOPTRO, etc.) along with diagnostic attributes (configured_profile,active_brand_code,active_brand). - Added localized translations for
brand_profileand selector options across English, German, Spanish, French, Italian, and Portuguese (en.json,de.json,es.json,fr.json,it.json,pt.json,pt-BR.json).
- Added
- SSL CLIENT CERTIFICATE INTEGRITY VALIDATION (
protocol/certs.py):- Implemented strict PEM certificate and private key validation via
validate_ssl_certs(). - Validates BEGIN/END headers, Base64 decoding, ASN.1 structure, modulus matching between certificate and private key, and PKCS#8 decryption without hard external cryptography dependencies.
- Provides clear, actionable error feedback when invalid or mismatched certificates are uploaded during manual certificate setup.
- Clarified universal app architecture in documentation: the official VIDAA Smart TV app (
com.universal.remote.multi) is universal across all brands and its client certificate (CN=VidaaAppAndroidV01) authenticates with any VIDAA OS TV.
- Implemented strict PEM certificate and private key validation via
- EVENT LOOP NON-BLOCKING CERTIFICATE RESOLUTION & PKCS#12 CACHING (
__init__.py,client.py,protocol/certs.py,config_flow.py,flow_reauth.py):- Resolves GitHub issue #49 (
Detected blocking call to open with args inside the event loop). - Offloaded certificate path searches,
resolve_certificates(), andresolve_ca_certificate()inasync_setup_entryto Home Assistant's threadpool executor viahass.async_add_executor_job(). - Hardened
HisenseTvClient.__init__to skip disk certificate scans and resolution entirely whenuse_ssl=False, for legacy/static auth profiles, or when valid pre-resolved PEM certificate and key paths are supplied. - Added timestamp-based (
mtime) disk caching inextract_pkcs12_to_pem()to reuse existing extracted PEM certificate and key files on subsequent startups without re-reading the.p12archive, performing write-access probe checks, or rewriting files. - Ensured
_async_resolve_ssl_certs()runs in the executor before client initialization in all config flow and re-authentication paths.
- Resolves GitHub issue #49 (
- ASYNC UPnP
<modelDescription>CAPABILITY EXTRACTION (protocol/upnp.py):- Enhanced
HisenseUpnpClient.async_get_device_fingerprint()to parse<modelDescription>as key-value pairs, extractingbrand,platform,vidaa_support,voice,transport_protocol,mac_wifi, andmac_ethernetasynchronously.
- Enhanced
- ZEROCONF / HOMEKIT mDNS METADATA ENRICHMENT (
discovery.py):- Enriched
parse_zeroconf_discovery()to extract actual model names (md/model) and manufacturer branding from mDNS TXT properties advertised by Apple HomeKit / AirPlay (_hap._tcp.local.,_airplay._tcp.local.). - Completely decoupled from control: graceful fallback to defaults if HomeKit/AirPlay is disabled or properties are absent.
- Enriched
- TEST SUITE MODULARIZATION & EXPANSION (262 PASSING TESTS):
- Decoupled oversized test suites into modular, single-responsibility modules:
- Split
test_client_auth.pyintotest_client_tokens.py(token lifecycle/drift/standby),test_client_reconnect.py(reconnect locks/backoff/rejection thresholds), andtest_client_auth.py(core auth profiles/probing). - Split
test_pairing.pyintotest_pairing_guards.py(abort flow/duplicate guards),test_pairing_cascade.py(brand fallback cascade/profile fallback), andtest_pairing.py(PIN challenge probing/flows). - Split
test_services.pyintotest_services_targeting.py(device/area/floor/label resolution & guards) andtest_services.py(service executions). - Added
test_multi_brand_readiness.pycovering OEM brand selectors, code preservation, cert hinting, UPnP MAC fallbacks, client ID regeneration, and post-PIN brand preservation. - Added comprehensive regression coverage for TOPTRO discovery, brand normalization, and probe rejection diagnostics in
tests/test_client_auth.pyandtests/test_discovery.py.
- Split
- 100% passing test suite across all 262 unit tests with 0 linter errors and 0 Hassfest errors.
- Decoupled oversized test suites into modular, single-responsibility modules: