Files
buryan-infra/ops/scripts/fix_byod_pc.py
T
root 855a596f1a
lint / hygiene (push) Failing after 15s
standard / check (push) Successful in 6s
[COMBINE] ПК с Teams Rooms тоже терминал (role=pc)
2026-11-18 16:19:03 +03:00

86 lines
3.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env python3
"""BYOD: ПК — терминальный хост, UVC85 BYOD — kit, UVC — камеры."""
import yaml
P = "/root/buryan-infra/ops/combine/catalog-p0-2026-11-18.yaml"
R = "/root/buryan-infra/ops/combine/BYOD-PC-TERMINALS-2026-11-18.md"
d = yaml.safe_load(open(P, encoding="utf-8"))
devs = d["devices"]
def get(name):
for x in devs:
if (x.get("model") or x.get("name")) == name:
return x
return None
def pc(x, own=False):
if not x:
return
x["role"] = "pc"
x["domain"] = "vcs"
x["group"] = "A_integration_terminals"
x["line"] = "vcs.terminals"
x["solution_class"] = "vcs.terminal.pc"
x["analog_group"] = "vcs.terminal.pc"
x["form_factor"] = "pc"
x["native_vcs"] = False
x["sales_scope"] = "own" if own else "alternative"
x["deployment"] = "byod"
x["requires"] = ["camera", "audio", "touch"]
pc(get("ПК (BYOD)"), own=True)
pc(get("ПК с Teams Rooms (MTR-W)"), own=True)
pc(get("HP Mini IP Conferencing PC"))
pc(get("HP Poly Studio 7 Room Compute"))
kit = get("UVC85-BYOD")
if kit:
kit["role"] = "kit"
kit["group"] = "A_integration_terminals"
kit["line"] = "vcs.byod.kit"
kit["solution_class"] = "vcs.byod.kit"
kit["analog_group"] = "vcs.byod.kit"
kit["form_factor"] = "kit"
kit["native_vcs"] = False
kit["deployment"] = "byod"
kit["aliases"] = sorted(set((kit.get("aliases") or []) + ["UVC85 BYOD 200", "UVC85-BYOD 200"]))
kit["components"] = ["UVC85", "BYOD-BOX"]
for x in devs:
n = (x.get("model") or x.get("name") or "").lower()
if n.startswith("uvc") and "byod" not in n:
x["role"] = "camera"
x["group"] = "D_usb_byod"
x["line"] = "vcs.usb_byod"
x["solution_class"] = "vcs.camera.usb"
x["analog_group"] = "vcs.camera.usb"
x["form_factor"] = "camera"
if n == "byod-box":
x["role"] = "sharing_hub"
x["group"] = "D_usb_byod"
x["solution_class"] = "vcs.sharing"
x["form_factor"] = "accessory"
if n == "mvc-byod-extender":
x["role"] = "sharing_hub"
x["group"] = "D_usb_byod"
x["solution_class"] = "vcs.sharing"
x["form_factor"] = "accessory"
yaml.safe_dump(d, open(P, "w", encoding="utf-8"), allow_unicode=True, sort_keys=False)
names = ["ПК (BYOD)", "HP Mini IP Conferencing PC", "HP Poly Studio 7 Room Compute", "UVC85-BYOD", "UVC85", "UVC86"]
lines = ["# BYOD и ПК как терминалы", "",
"ПК — терминальный хост BYOD-решения, не аксессуар.", "",
"| Модель | role | group | solution_class | deployment |", "|---|---|---|---|---|"]
for n in names:
x = get(n)
if x:
lines.append("| %s | %s | %s | %s | %s |" % (n, x.get("role"), x.get("group"),
x.get("solution_class"), x.get("deployment", "")))
lines += ["", "`UVC85-BYOD` = kit (`UVC85` + `BYOD-BOX`), алиасы `UVC85 BYOD 200` / `UVC85-BYOD 200`.",
"UVC85/UVC86 — камеры; с ПК образуют BYOD-решение без кодека."]
open(R, "w", encoding="utf-8").write("\n".join(lines) + "\n")
print("fixed byod/pc", len(devs))