{"id":18368652,"url":"https://github.com/openbmc/phosphor-led-manager","last_synced_at":"2025-04-06T17:31:47.450Z","repository":{"id":53424728,"uuid":"71132473","full_name":"openbmc/phosphor-led-manager","owner":"openbmc","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-17T11:34:22.000Z","size":1877,"stargazers_count":7,"open_issues_count":4,"forks_count":13,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-22T04:02:04.331Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openbmc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-17T11:46:18.000Z","updated_at":"2025-03-19T06:38:57.000Z","dependencies_parsed_at":"2023-02-02T18:45:16.357Z","dependency_job_id":"25a22113-721a-4fe6-b089-85ae8a095f2e","html_url":"https://github.com/openbmc/phosphor-led-manager","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openbmc%2Fphosphor-led-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openbmc%2Fphosphor-led-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openbmc%2Fphosphor-led-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openbmc%2Fphosphor-led-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openbmc","download_url":"https://codeload.github.com/openbmc/phosphor-led-manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247522390,"owners_count":20952540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T23:26:53.910Z","updated_at":"2025-04-06T17:31:46.631Z","avatar_url":"https://github.com/openbmc.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phosphor-led-manager\n\nThis project manages LED groups on dbus. Sometimes many LEDs must be driven\ntogether to indicate some system state.\n\nFor example, there can be multiple identify LEDs. When the user wants to\nidentify the system, they should all light up together.\n\n## Configuration\n\nThe configuration can happen via json or yaml.\n\n### Configuration: LED Priority\n\nEach LED can have \"Priority\" as \"Blink\", \"Off\" or \"On\". If this property is\ndefined, it should be defined on each instance of the LED in the config.\n\nWhen multiple LED groups are asserted and contain the same LED, \"Priority\"\ndetermines the state of the LED.\n\nFor example, Group 1 says LED1 should be \"Blink\", and Group 2 says it should be\n\"On\". LED1 will then have the state declared in \"Priority\".\n\n## Configuration: LED Group Priority\n\nUsing LED Priority is fine for simple configurations, but when group state needs\nto always be consistent, Group Priority can be used to enforce the consistent\nrepresentation.\n\nThe Group `Priority` is optional and a higher priority means that when 2 groups\nare asserted, the one with highest `Priority` will be represented consistently.\nMeaning all its LEDs will have the state as per the configuration.\n\n## Configuration Example with Group Priorities (JSON)\n\nHere we prioritize the locating group above the fault group since locating may\nbe required to fix the fault.\n\nSo independent of the order that these groups are asserted, if both are\nasserted, \"sys_id\" should be in \"Blink\" state.\n\nThe \"unrelated\" group will have the default group priority of 0.\n\n```json\n{\n  \"leds\": [\n    {\n      \"group\": \"enclosure_identify\",\n      \"Priority\": 2,\n      \"members\": [\n        {\n          \"Name\": \"sys_id\",\n          \"Action\": \"Blink\"\n        },\n        {\n          \"Name\": \"rear_id\",\n          \"Action\": \"Blink\"\n        }\n      ]\n    },\n    {\n      \"group\": \"fault\",\n      \"Priority\": 1,\n      \"members\": [\n        {\n          \"Name\": \"sys_id\",\n          \"Action\": \"On\"\n        },\n        {\n          \"Name\": \"fault\",\n          \"Action\": \"On\"\n        }\n      ]\n    },\n    {\n      \"group\": \"unrelated\",\n      \"members\": [\n        {\n          \"Name\": \"rear_id\",\n          \"Action\": \"On\"\n        }\n      ]\n    }\n  ]\n}\n```\n\n### Configuration Example (JSON)\n\nThis is our configuration file. It describes 2 LEDs for the\n'_enclosure_identify_' group, with their respective states and duty cycles.\n\n```json\n{\n  \"leds\": [\n    {\n      \"group\": \"enclosure_identify\",\n      \"members\": [\n        {\n          \"Name\": \"pca955x_front_sys_id0\",\n          \"Action\": \"On\",\n          \"DutyOn\": 50,\n          \"Period\": 0,\n          \"Priority\": \"Blink\"\n        },\n        {\n          \"Name\": \"led_rear_enc_id0\",\n          \"Action\": \"On\",\n          \"DutyOn\": 50,\n          \"Period\": 0,\n          \"Priority\": \"Blink\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nThen start the program with\n\n```text\n~# ./phosphor-led-manager --config example.json\n```\n\n## Dbus interface\n\nWhen starting the program, our LED group shows up on dbus. Usually there will be\nmany more groups.\n\n```text\n$ busctl tree xyz.openbmc_project.LED.GroupManager\n`- /xyz\n  `- /xyz/openbmc_project\n    `- /xyz/openbmc_project/led\n      `- /xyz/openbmc_project/led/groups\n        `- /xyz/openbmc_project/led/groups/enclosure_identify\n\n\n$ busctl introspect xyz.openbmc_project.LED.GroupManager /xyz/openbmc_project/led/groups/enclosure_identify\nNAME                                TYPE      SIGNATURE RESULT/VALUE FLAGS\n...\nxyz.openbmc_project.Led.Group       interface -         -            -\n.Asserted                           property  b         false        emits-change writable\n```\n\nIn the above output, the usual org.freedesktop.\\* interfaces have been removed\nto keep it readable.\n\nWe can now drive the entire group by setting it's 'Asserted' property on dbus.\n\n```text\n$ busctl set-property \\\nxyz.openbmc_project.LED.GroupManager \\\n/xyz/openbmc_project/led/groups/enclosure_identify \\\nxyz.openbmc_project.Led.Group Asserted b true\n```\n\nThe program can then use the _xyz.openbmc_project.Led.Physical_ dbus interface\nexposed by _phosphor-led-sysfs_ to set each LED state.\n\n## How to Build\n\n```text\nmeson setup build\ncd build\nninja\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenbmc%2Fphosphor-led-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenbmc%2Fphosphor-led-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenbmc%2Fphosphor-led-manager/lists"}