You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							29 lines
						
					
					
						
							826 B
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							29 lines
						
					
					
						
							826 B
						
					
					
				| package events | |
| 
 | |
| import ( | |
| 	"fmt" | |
| 	"git.aiterp.net/lucifer3/server/device" | |
| ) | |
| 
 | |
| type HardwareState struct { | |
| 	ID           string              `json:"internalId"` | |
| 	InternalName string              `json:"internalName"` | |
| 	SupportFlags device.SupportFlags `json:"deviceFlags"` | |
| 	ColorFlags   device.ColorFlag    `json:"colorFlags"` | |
| 	Buttons      []string            `json:"buttons"` | |
| 	State        device.State        `json:"state"` | |
| } | |
| 
 | |
| func (d HardwareState) EventDescription() string { | |
| 	return fmt.Sprintf("HardwareState(id:%s, iname:%#+v, sflags:%s, cflags:%s, buttons:%v, state:%s)", | |
| 		d.ID, d.InternalName, d.SupportFlags, d.ColorFlags, d.Buttons, d.State, | |
| 	) | |
| } | |
| 
 | |
| type Unreachable struct { | |
| 	DeviceID string `json:"deviceId"` | |
| } | |
| 
 | |
| func (d Unreachable) EventDescription() string { | |
| 	return fmt.Sprintf("Unreachable(id:%s)", d.DeviceID) | |
| }
 |