|
|
@ -94,6 +94,24 @@ func WriteDeviceInfoTable(w io.Writer, devices []models.Device) { |
|
|
|
table.Render() |
|
|
|
} |
|
|
|
|
|
|
|
func WriteSceneTable(w io.Writer, scenes []models.Scene) { |
|
|
|
table := tablewriter.NewWriter(w) |
|
|
|
table.SetHeader([]string{"ID", "NAME", "ROLES", "INTERVAL"}) |
|
|
|
|
|
|
|
table.SetReflowDuringAutoWrap(false) |
|
|
|
|
|
|
|
for _, v := range scenes { |
|
|
|
table.Append([]string{ |
|
|
|
fmt.Sprint(v.ID), |
|
|
|
v.Name, |
|
|
|
fmt.Sprint(len(v.Roles)), |
|
|
|
fmt.Sprint(v.IntervalMS), |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
table.Render() |
|
|
|
} |
|
|
|
|
|
|
|
func WriteHandlerInfoTable(w io.Writer, handlers []models.EventHandler) { |
|
|
|
table := tablewriter.NewWriter(w) |
|
|
|
table.SetHeader([]string{"ID", "EVENT NAME", "PRIORITY", "CONDITIONS", "TARGET", "ACTION"}) |
|
|
|